Initialize array of objects not work

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 4 06:48:46 PDT 2016


On 8/3/16 2:34 PM, Ali Çehreli wrote:

> void main() {
>     Element[] elements = cast(Element[])[ quadraticCoefficient(1),
> linearCoefficient(2), equals(), constant(1) ];

is the cast necessary? I assumed the compiler would infer the common 
base type...

-Steve


More information about the Digitalmars-d-learn mailing list