DMD 1.035 and 2.019 releases

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Sep 4 05:48:18 PDT 2008


On Thu, Sep 4, 2008 at 7:44 AM, Tomas Lindquist Olsen <tomas at famolsen.dk> wrote:

> The most important point to me, is that old thing about static struct
> initializer and struct literals have different syntaxes, and that the static
> variant is much more flexible.
>
> I would have loved to see the static struct initializer syntax become an
> expression. If the problem is ambiguity, why not just prefix the {} braces
> with the struct name?
>
> struct S
> {
>  int a;
>  float b;
> }
>
> const s = S{1, 2.0};
> const t = S{b:3.14};
>
> void foo()
> {
>  auto st = S{4,5.5};
> }
>
> (also not that it's currently impossible to use type inference with the
> current static struct initializers)
>
> This would eliminate the gripe most people have with this I think, as well
> as making static and  non-static initializers consistent. like they are *for
> all other types*.

Now were you just reading off of
http://d.puremagic.com/issues/show_bug.cgi?id=2170 or did you come to
this conclusion independently ;)


More information about the Digitalmars-d-announce mailing list