inheriting ctors?

Simen kjaeraas simen.kjaras at gmail.com
Thu Aug 5 13:14:19 PDT 2010


dcoder <dcoder at devnull.com> wrote:

> Suppose I have a base class with many ctors().
>
> I want to inherit from the base class and make one slight alteration to  
> it,
> but I don't want to write X times the following:
>
> this(args) {
>   super(args);
> }
>
> Does D have an easy way for the derived class to 'inherit' all or some  
> of the
> base class ctors(), and just override/add ctors() in the derived class?

No easy way, no. The best solution might be template or string mixins.

-- 
Simen


More information about the Digitalmars-d-learn mailing list