Proposal: real struct literals

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 24 14:30:56 PDT 2008


"Jarrett Billingsley" wrote
> So I propose that struct "literals" be replaced with actual struct 
> literals, which look like static struct initializers.  There is a very 
> obvious, simple, unambiguous syntax for this: an identifier, followed by a 
> static struct initializer.  Crazy, I know!
>
> static s = S{ 5, y: 10, s: "hi!" };
> auto s2 =  S{ 5, y: 10, s: "hi!" };

Agree 100%

-Steve 





More information about the Digitalmars-d mailing list