Order of base-class constructor calls

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Oct 11 09:40:29 PDT 2011


Nope. Private ctors have to be called from within the same module,
whether implicit or not:

test.d:
class Foo
{
    private this() { }  // Error: constructor main.Bar.this no match
for implicit super() call in constructor
}

import test;
class Bar : Foo
{
    this() { }
}

void main()
{
    auto bar = new Bar();
}


More information about the Digitalmars-d-learn mailing list