inheriting ctors?

Sean Kelly sean at invisibleduck.org
Thu Aug 5 16:24:56 PDT 2010


Steven Schveighoffer Wrote:

> 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?

If it helps, I wrote up something on this a few years back:

http://www.digitalmars.com/d/archives/digitalmars/D/Inheriting_constructors_54088.html

Might be a good starting point for an enhancement request.


More information about the Digitalmars-d-learn mailing list