bad_cast class — Exception for dynamic_cast<>
class bad_cast : public exception { public: bad_cast( ) throw( ); bad_cast(const bad_cast&) throw( ); bad_cast& operator=(const bad_cast&) throw( ); virtual ~bad_cast( ) throw( ); virtual const char* what( ) const throw( ); };
The dynamic_cast<>
operator throws bad_cast
when the
cast of a reference fails. See dynamic_cast
in Chapter 3 for more
information.