Hacker News new | ask | show | jobs
by patrick451 1039 days ago
C++ has had designated initializers since c++20.
2 comments

Point taken, I was inaccurate. Out of order designated initializers still don't work in C++20, right? Which still means C++ isn't a superset of C.
Any look into this will show that C's designated initializers are significantly more flexible/better in every way.
It’s amusing to me that whenever C has a feature that C++ doesn’t, C programmers hammer on the usefulness and power of said feature, but on the converse those same C programmers hammer on the divine simplicity of C.

C++ has constructors, it doesn’t really need designated initializers in the first place. They were added primarily for C compatibility.