// Single inheritance - C++11 variant. // Illustrates how it is possible to inherit the constructors from Base. C++11. #include using namespace std; class Base{ private: int i; string s; public: Base(): i{0}, s{string("Hi")}{ } Base(int i): i{i}, s{string("Hi")}{ } Base(int i, string s): i{i}, s{s}{ } }; class Derived: public Base{ // No state in Derived public: using Base::Base; // A using declaration: // Inherit the constructors from Base (!!) // The C++ Programming Language, 4ed, 20.3.5.1 (page 594). }; int main(){ Derived d1, // OK d2(5), // OK d3(6, string("AP")); // OK }