Resizing array of classes

Jacob Carlborg doob at me.com
Fri Oct 19 06:41:53 PDT 2012


On 2012-10-19 11:42, Marco Leise wrote:

> When you extend the length of an array, it is filled with
> the static .init value for the type, which is null here. I
> think you'll have to create the objects manually.
>
> foreach (ref foo; a) foo = new Foo;

Is this possible:

a[] = new Foo;

?

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list