www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8282] New: Can not allocate an Array!T on heap.


           Summary: Can not allocate an Array!T on heap.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: tobias pankrath.net

PDT ---
from the newsgroup:

On Friday, 22 June 2012 at 10:19:13 UTC, Timon Gehr wrote:
 On 06/22/2012 08:45 AM, Tobias Pankrath wrote:
 import std.container;

 struct A {};

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


 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 !()()
This seems to work: import std.container; struct A {}; void main() { auto arr = new Array!A(A.init); }
I think it should work, though. Otherwise it should be made explicit in the documentation how to do this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 22 2012