www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14222] New: emplace implicit dynamic to static array fails


          Issue ID: 14222
           Summary: emplace implicit dynamic to static array fails
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

struct S
    this(int[3] a){}

    auto s0 = S([1,2,3]); //OK
    import std.conv : emplace;
    auto s1 = emplace!S(&s0, [1,2,3]); //Error

std/conv.d(4067): Error: static assert  "S cannot be emplaced from (int[])."
std/conv.d(4132):        instantiated from here: emplaceImpl!(int[])
emplaceTest.d(10):        instantiated from here: emplace!(S, int[])

Feb 24 2015