Summary: std.conv.emplace() doesn't work w/ struct literals, as
                    opposed to c'tors.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from David Simcha <> 2010-08-17 18:18:26 PDT ---
import std.conv;

struct Foo {
    uint num;

void main() {
    Foo foo;
    auto voidArr = (cast(void*) &foo)[0..Foo.sizeof];
    emplace!(Foo)(voidArr, 2U);

d:\dmd2\windows\bin\..\..\src\phobos\std\conv.d(3805): Error: cannot implicitly
convert expression (_param_1) of type uint to Foo
d:\dmd2\windows\bin\..\..\src\phobos\std\conv.d(10): Error: template instance
std.conv.emplace!(Foo,uint) error instantiating

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to