Skip to content

Conversation

@N-Dekker
Copy link
Contributor

@N-Dekker N-Dekker commented Oct 23, 2025

Replaced variable initializations of the form auto var{ value } with auto var = value.

Using regular expressions, replacing ( auto[ ]+\w+){ (.+) }; with $1 = $2;.


hjmjohnson and others added 2 commits October 22, 2025 13:09
Since C++11, the brace form {} is preferred in most cases because it provides
safer, more consistent, and less surprising behavior.

{} (brace initialization) disallows implicit conversions that lose information.
Replaced variable initializations of the form `auto var{ value }` with `auto var = value`.

Using regular expressions, replacing `( auto[ ]+\w+){ (.+) };` with `$1 = $2;`.
@N-Dekker N-Dekker requested a review from hjmjohnson October 23, 2025 14:30
@github-actions github-actions bot added type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module type:Style Style changes: no logic impact (indentation, comments, naming) area:Numerics Issues affecting the Numerics module labels Oct 23, 2025
@dzenanz
Copy link
Member

dzenanz commented Oct 23, 2025

I also prefer "equals" style for auto variables.

@N-Dekker
Copy link
Contributor Author

@hjmjohnson
Copy link
Member

@N-Dekker Let's go ahead and move forward with this. What needs to happen next?

@N-Dekker
Copy link
Contributor Author

Let's go ahead and move forward with this. What needs to happen next?

If you agree, merge this one with your "change-initialziation" branch. Note that we might still reconsider brace-init with auto, for example when the C++ Core Guidelines might "embrace" that brace-init with auto more explicitly (possibly via my PR isocpp/CppCoreGuidelines#2296). Or when tools like clang-tidy support such a refactoring out-of-the-box. Or when we feel more community support to go that way.

Once this is merged to "change-initialziation" branch, I definitely find it easier to "embrace" your PR #5569. Because I like most of it already.

@hjmjohnson hjmjohnson force-pushed the change-initialziation branch from dd42472 to 4950b00 Compare October 23, 2025 19:10
@hjmjohnson
Copy link
Member

Changes merged with #5569 as requested.

@hjmjohnson hjmjohnson closed this Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Numerics Issues affecting the Numerics module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module type:Style Style changes: no logic impact (indentation, comments, naming) type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants