Tuesday, 10 September 2013

Why does C++11 not support designated initializer list as C99?

Why does C++11 not support designated initializer list as C99?

struct Person
{
int height;
int weight;
int age;
};
int main()
{
Person p { .age = 18 };
}
The code above is legal in C99 but not legal in C++11.
What's the rationale that C++11 doesn't support such a handy feature?

No comments:

Post a Comment