casting array literals doesn't work as stated in the docs

bearophile bearophileHUGS at lycos.com
Sun Jan 3 03:20:44 PST 2010


Trass3r:
> > short[] t = cast(short[])[5,3];
> > short[] t2 = cast(short[])[5,3].dup;
> > 
> 
> Second one still doesn't work at compile-time.

It's not supposed to work, "dup" allocated memory with malloc, so it's (currently) a run time thing (in future this may change).

Bye,
bearophile



More information about the Digitalmars-d mailing list