Following up on Monday's linked article:
Inheriting Constructors in C++11
by 741MHz
From the article:
Delegating Constructors [... are] extremely useful in boosting efficiency, [but] it does not solve the problem when programmer wants to create a derived class that has exactly the same set of constructor as its base class or classes. In which case programmers are forced to tediously duplicate constructors of the base class...
C++11 solves this problem by introducing constructor inheritance. In a derived class, programmers can write a single
using T::T;
statement that makes a derived class automatically inherit constructors of a base class. For example: ...
Add a Comment
Comments are closed.