[Issue 2786] New: Interfaces should be able to require constructors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 2 10:59:13 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2786

           Summary: Interfaces should be able to require constructors
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


This should work:

interface Foo
{
    this(); // default construction is enabled
    this(this); // copy construction is enabled
    this(int); // construction from an int
}

Copy construction does not make sense for classes, but will make for struct
once struct inheritance of interfaces will be defined.


-- 



More information about the Digitalmars-d-bugs mailing list