Allocate an Array!T on the heap?

Tobias Pankrath tobias at pankrath.net
Thu Jun 21 23:45:36 PDT 2012


import std.container;

struct A {};

void main()
{
     Array!(A)* arr = new Array!(A);
}

yields


bug.d(7): Error: template std.container.Array!(A).Array.__ctor 
does not match any function template declaration
/usr/include/d/std/container.d(1625): Error: template 
std.container.Array!(A).Array.__ctor(U) if 
(isImplicitlyConvertible!(U,T)) cannot deduce template function 
from argument types !()()



More information about the Digitalmars-d-learn mailing list