new array without auto-initialization

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Sep 26 14:23:58 PDT 2013


On Thu, Sep 26, 2013 at 11:23:10PM +0200, Joseph Rushton Wakeling wrote:
> Hello all,
> 
> Suppose I create a new dynamic array:
> 
>     auto arr = new int[10];
> 
> If I recall right, the values inside arr will be auto-initialized to
> int.init (which is 0).
> 
> Again, if I recall right, there's a simple way to increase
> performance by not auto-initializing the values, but I can't
> remember what it is.
[...]

You mean:

	int[10] arr = void;

?


T

-- 
He who laughs last thinks slowest.


More information about the Digitalmars-d-learn mailing list