https://issues.dlang.org/show_bug.cgi?id=6421

Andrej Mitrovic <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Andrej Mitrovic <[email protected]> ---
With recent changes we can now use this syntax for initialization of a
variable:

-----
void main()
{
    float x = float(1.0);
}
-----

And in OpenGL, you can use this syntax for array initializers:

-----
float a[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1);
-----

So this got me thinking, the initializer looks very much like the new
initializer in D that we introduced. With a parser fix we could implement this
in D:

-----
void main()
{
    float[3] arr = float[3](1.0, 2.0, 3.0);
}
-----

Even though Issue 2356 is fixed the above might help in some other contexts,
perhaps in array appends.

--

Reply via email to