Re:The C++20 Naughty and Nice List for Game Devs
by calamari4065 on Monday December 25, 2023 @11:40AM
(#38763948)
Oh man, I've desperately wanted both of these features in basically every language I've used.
I think you can do a similar sort of array initialization in C#, but definitely not chained initializers. Those are both so useful, but I can see why they aren't included in C++/++
Re:The C++20 Naughty and Nice List for Game Devs
by loeg on Monday December 25, 2023 @12:27PM
(#38764363)
> all those limitations taken together, and the C++ designated initialization feature is pretty much useless except for the most trivial structs
We find it pretty useful even with the limitations. Certainly not “pretty much useless.”
...no chaining of designated initializers:
...and no array indexing: ...all those limitations taken together, and the C++ designated initialization feature is pretty much useless except for the most trivial structs - while in C99, designated initialization really shines with complex, nested structs.The funny thing is that none of those limitations would be required. Clang had supported full C99 designated init in C++ mode just fine for many years before C++20 appeared.