...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::contract::bad_virtual_result_cast — Exception thrown when inconsistent return values are passed to overridden virtual public functions.
// In header: <boost/contract/core/exception.hpp> class bad_virtual_result_cast : public std::bad_cast, public boost::contract::exception { public: // public member functions explicit bad_virtual_result_cast(char const *, char const *); virtual ~bad_virtual_result_cast(); virtual char const * what() const; };
This exception is thrown when programmers pass to this library return value parameters for public function overrides in derived classes that are not consistent with the return type parameter passed for the virtual public function being overridden from the base classes. This allows this library to give more descriptive error messages in such cases of misuse.
This exception is internally thrown by this library and programmers should not need to throw it from user code.
See Also: Public Function Overrides
bad_virtual_result_cast
public member functionsexplicit bad_virtual_result_cast(char const * from_type_name, char const * to_type_name);Construct this object with the name of the from- and to- result types.
Parameters: |
|
virtual ~bad_virtual_result_cast();Destruct this object.
Throws: This is declared noexcept
(or throw()
before C++11).
virtual char const * what() const;Description for this error (containing both from- and to- type names).
Throws: This is declared noexcept
(or throw()
before C++11).