rename this to ctor

davidl davidl at 126.com
Wed Apr 1 01:57:35 PDT 2009


class v
{
    this()
    {}
}

This "this" conflicts with the concept of "alias this" in D2.0

class base
{
     ctor()
     {
     }
}

class inherit:base
{
    alias base.ctor ctor; // bring up the ctor to overload, iirc, there  
were people who called for this feature
     ctor(int i)
    {
    }
}

so I can do:
auto inst = new inherit();
auto inst1 = new inherit(34);



More information about the Digitalmars-d mailing list