inheriting ctors?

Steven Schveighoffer schveiguy at yahoo.com
Thu Aug 5 11:01:39 PDT 2010


On Thu, 05 Aug 2010 13:53:20 -0400, 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?

Sadly, no.  It's been discussed in the past.  I was surprised there were  
no enhancement requests for it in bugzilla, care to add one?

You may be able to do it with templated constructors, but documentation  
would suck...

-Steve


More information about the Digitalmars-d-learn mailing list