3 ms·
The out of order initialisation is not supported because it would be confusing with the order of destruction. Note that initializing the members in a constructo
by varajelle 5y ago
The out of order initialisation is not supported because it would be confusing with the order of destruction.
Note that initializing the members in a constructor in a different order is allowed, but they are actually still initialized in the declaration order. That's quite confusing and most compiler warn about that. So in a way it's good the same mistake was not done in designated initialized.
I don't know why the array notation is not allowed in C++.
- flohofwoe 5y agoApparently the array initialization clashes with lambda syntax. Regarding all the restrictions added in C++20: Clang supported the full C99 designated intiialization feature set in C++ without any issues long before C++20, so the decision by the C++ Committee to add those restrictions is quite baffling, considering that there is a solid implementation in the wild that has been working just fine for many years.