Re:What is your favorite C programming trick? (2009)
by pjmlp on Sunday November 22, 2020 @01:13PM
(#25179546)
Doesn't matter, the point was what C subset does C++ support today.
Re:What is your favorite C programming trick? (2009)
by vitus on Sunday November 22, 2020 @06:22PM
(#25182043)
C++20 designated initializers must be specified in definition order, whereas they don't in C99.
In your example,
Point point = {.z = 2.0, .x = 1.0};
produces a compilation error. This is annoying, but workable. And at least it's a compile-time error, rather than a bug that perniciously sneaks into production.
Took them only 21 years... And this standard being so recent, most projects won't have that for years to come.