how to initialize an array of typedef-ed type?

Jarrett Billingsley jarrett.billingsley at gmail.com
Fri May 1 08:53:09 PDT 2009


On Fri, May 1, 2009 at 11:34 AM, MLT <none at anone.com> wrote:

>
> Is there an easy way to convert arrays from one type to another?
> int[] a=[1,2,3,4] ;
> long[] b ;

Not really.  The best you can do is:

b.length = a.length;
foreach(i, ref v; b) v = a[i];


More information about the Digitalmars-d-learn mailing list