// Attempting to inherit constructors - does not compile. C++11. // Problems in this version. The next version of the program shows a convenient solution. #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: Derived() = default; // Means: We are happy with the default constructor }; int main(){ Derived d1, // OK d2(5), // Error: no matching function for call to 'Derived::Derived(int)' d3(6, string("AP")); // Error: no matching function for call to 'Derived::Derived(int, std::string)' }