This is the correct syntax:
class err : public A, public std::runtime_error
And not:
class err : public A, public std::runtime_error("")
As you do above. If you want to pass an empty string to the std::runtime_error , do this as follows:
class err : public A, public std::runtime_error { public: err() : std::runtime_error("") { } // ^^^^^^^^^^^^^^^^^^^^^^^^ };
Here is a live example to show code compilation.
Andy prowl
source share