constructor inheritance

Ary Borenszweig ary at esperanto.org.ar
Tue Mar 4 11:18:29 PST 2008


Elwis wrote:
> I might have described my problem unclearly.
> 
> I has root class and it has some constructor. One of those just calls one of its methods. I'd like not to copy declaration of this constructor in all of its children.

Do you mean you don't want to have to do this?

class Parent {

   this(int x, int y) {
     // some code
   }

}

class Child : Parent {

   // I wish the compiler would add the this(int x, int y) constructor
   // automatically for me here

}



More information about the Digitalmars-d mailing list