filling arrays, avoid default init

Lionello Lunesu lio at lunesu.remove.com
Tue Jan 9 07:15:38 PST 2007


Frank Benoit (keinfarbton) wrote:
> TypeA[] ta = .... ; // big array with something
> TypeB[] tb;
> tb.length = ta.length; // (1)
> foreach( uint i, TypeA a; ta ){
>   tb[i] = ta[i].getB();
> }
> 
> (1) how can I avoid the default initialization?
> 
> -- Frank

type[] t = void;


More information about the Digitalmars-d-learn mailing list