Can we drop static struct initializers?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Nov 20 08:05:43 PST 2009
Don wrote:
> Now that we have struct literals, the old C-style struct initializers
> don't seem to be necessary.
> The variations with named initializers are not really implemented -- the
> example in the spec doesn't work, and most uses of them cause compiler
> segfaults or wrong code generation. EG...
>
> struct Move{
> int D;
> }
> enum Move genMove = { D:4 };
> immutable Move b = genMove;
>
> It's not difficult to fix these compiler problems, but I'm just not sure
> if it's worth implementing. Maybe they should just be dropped? (The {
> field: value } style anyway).
Would love to. At least we can deprecate them and not mention them in TDPL.
Andrei
More information about the Digitalmars-d
mailing list