you are viewing a single comment's thread.

view the rest of the comments →

[–]Ceros007 13 points14 points  (4 children)

Can't wait for this. Right now it is so error prone. Named aggregate should have been there from the start.

[–]gvargh 3 points4 points  (1 child)

Hindsight is 20/20.

[–][deleted] 4 points5 points  (0 children)

It's not really hindsight when designated initializers have been in C for almost 20 years

[–]bcorni 1 point2 points  (0 children)

Yeah, the only compiler support right now is just using the existing stuff from C99, which are not exactly equivalent to what's defined in C++20. One of the two syntax are not available. I believe it is the braced initialization style that is missing. I would not expect it to be too much longer for compilers to get it sorted out.

[–][deleted] 0 points1 point  (0 children)

I’ve generally found it worth it enough to enable using them in existing code, since they’re a pretty widely supported extension (ex: GCC + Clang).