Skip to content

Conversation

@mizdebsk
Copy link
Member

Simplify return statements by using braced initializer lists instead of repeating the return type. This improves readability and avoids unnecessary verbosity, especially for types already stated in the function signature.

Simplify return statements by using braced initializer lists instead
of repeating the return type.  This improves readability and avoids
unnecessary verbosity, especially for types already stated in the
function signature.
@mkoncek
Copy link
Member

mkoncek commented Jul 23, 2025

This comes from my personal dislike of the {}-init syntax which is encouraged. The fact that it doesn't want to allow implicit conversions led me multiple times to switch away from it, when changing code elsewhere.
Moreover, a few years ago, the code suggestion tools I used were not able to help with this syntax, but were able to suggest when using the () syntax.
This led me to universally abandon this init syntax and I wanted to stay consistent.
I don't see a problem to use braces in your PR other than breaking consistency.

@mizdebsk
Copy link
Member Author

Fine by me, the explanation makes sense.

@mizdebsk mizdebsk closed this Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants