Struct literals and AA literals

Lodovico Giaretta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 24 10:53:40 PDT 2016


On Tuesday, 24 May 2016 at 06:59:18 UTC, Jacob Carlborg wrote:
> What we need is something like this [1]:
>
> auto c = Config{ foo: "foo", bar: "bar };
>
> The compiler will know for sure that "c" is of type Config 
> because the right side includes the type.
>
> [1] https://issues.dlang.org/show_bug.cgi?id=15692

It would indeed be very handy to have this syntax.
Thank you for creating the enhancement request.

Lodovico Giaretta




More information about the Digitalmars-d-learn mailing list