Skip to content

Comments

STYLE: Use C++17 nested namespace syntax#5407

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
hjmjohnson:propose-c++17-nested-namespace
Jun 17, 2025
Merged

STYLE: Use C++17 nested namespace syntax#5407
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
hjmjohnson:propose-c++17-nested-namespace

Conversation

@hjmjohnson
Copy link
Member

Replace nested namespaces such as 'namespace a { namespace b { ... } }' and changes to the more concise syntax introduced in C++17: 'namespace a::b { ... }'.

Inline namespaces are not modified.

Disabled KWStyle Namespace checking that is incapable of supporting the c++17 nested namespace formatting.

PR Checklist

Replace nested namespaces such as 'namespace a { namespace b { ... } }'
and changes to the more concise syntax introduced in C++17:
'namespace a::b { ... }'.

Inline namespaces are not modified.

Disabled KWStyle Namespace checking that is incapable of
supporting the c++17 nested namespace formatting.
@hjmjohnson hjmjohnson self-assigned this Jun 16, 2025
@hjmjohnson hjmjohnson added the type:Style Style changes: no logic impact (indentation, comments, naming) label Jun 16, 2025
@hjmjohnson
Copy link
Member Author

This is a style proposal to make use of the C++17 formatted nested namespace conventions. I think that this compact format is much easier to read and maintain. It does require disabling the KWStyle Namespace checking, because that checker does not support nested namespaces.

Perhaps it would be easy to update KWStyle to accept "itk [:]+." instead of the exact "itk" string.

@hjmjohnson hjmjohnson marked this pull request as draft June 16, 2025 22:13
@hjmjohnson hjmjohnson changed the title STYLE: Use C++17 nested namespace syntax COMMENTS REQUESTED STYLE: Use C++17 nested namespace syntax Jun 16, 2025
Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this.

@hjmjohnson hjmjohnson marked this pull request as ready for review June 17, 2025 13:45
@hjmjohnson
Copy link
Member Author

Thanks @dzenanz , @N-Dekker , @blowekamp for your support. Given no identification of concerns, I'll leave this open until later this afternoon, then merge if no other responses come through.

@hjmjohnson hjmjohnson changed the title COMMENTS REQUESTED STYLE: Use C++17 nested namespace syntax STYLE: Use C++17 nested namespace syntax Jun 17, 2025
@hjmjohnson hjmjohnson merged commit 5027238 into InsightSoftwareConsortium:master Jun 17, 2025
16 checks passed
@seanm
Copy link
Contributor

seanm commented Jun 18, 2025

Do you make this change with a linter tool? Manually? Custom script?

@hjmjohnson hjmjohnson deleted the propose-c++17-nested-namespace branch June 24, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Style Style changes: no logic impact (indentation, comments, naming)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants