Standard exception classes are derived from std::exception (defined in the
#include #include using namespace std;class A{};class B{ public: virtual ~B() {} };void main(){ B b; try{ A a= dynamic_cast < A& > (b); //runtime exception; no conversion from B& to A& exists } catch (exception & ex) { cout<< ex.what() <