Summary: scoped + private constructor
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from David Simcha <> 2010-08-12 18:33:26 PDT ---
import std.typecons;

class Foo {
    private this(int num) {}

void main() {
    auto s = scoped!Foo(1);

d:\dmd2\windows\bin\..\..\src\phobos\std\conv.d(3903): Error: static assert 
"Don't know how to initialize an object of type Foo with arguments (int
d:\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(2314):        instantiated
from here: emplace!(Foo,int)
test9.d(8):        instantiated from here: scoped!(Foo,int)

Changing the c'tor to public fixes this.

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

Reply via email to