I\'ve got a question about one of the c++20 feature, designated initializers (more info about this feature here)
#include
constexpr unsigne
You might have several fields with same name from different bases,
so logically, you should provide name of the wanted base, but it seems there is no way to do it.
// Invalid too:
Employee e1{.Person.name{"John"}, .Person.surname{"Wick"}, .Person.age{40}, .salary{50000}};
Employee e2{.Person{.name{"John"}, .surname{"Wick"}, .age{40}}, .salary{50000}};
In addition C++ designated initialization is more constrained than C:
Note: out-of-order designated initialization, nested designated initialization, mixing of designated initializers and regular initializers, and designated initialization of arrays are all supported in the C programming language, but are not allowed in C++.