LWN.net Logo

Well, it's quite simple, really...

Well, it's quite simple, really...

Posted Jan 18, 2011 18:57 UTC (Tue) by daniel (subscriber, #3181)
In reply to: Well, it's quite simple, really... by dwmw2
Parent article: Sobotka: Why GIMP is inadequate

The lack of designated initializers in C++ is pure brain damage. I do not understand why the issue does not get more attention. That said, the old gnu syntax still works: {foo: x, bar: y} except that you have to specify the initializers in the order declared and insert nulls if you skip fields, the latter requirement serving no imaginable purpose whatsoever. But at least in this way you can protect yourself from structure field evolution. This C advantage in no way makes up for all the structuring primitives that C lacks.


(Log in to post comments)

Well, it's quite simple, really...

Posted Jan 18, 2011 21:07 UTC (Tue) by foom (subscriber, #14868) [Link]

It doesn't sound like brain damage, but rather a brand new (well, 12 years old now, but by C standards, brand new) feature in C that has not been ported to C++ yet. C++ adds all sorts of additional complex interactions to such a feature that would have to be properly specified...and nobody's done that yet. You could probably get a proposal accepted for C++20 (or whatever) though...

The restrictions on the GCC extension seem like someone just didn't really finish implementing it yet. I'd bet you would be welcome to do so.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds