...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::typeindex::runtime_cast — Safely converts references to classes up, down, and sideways along the inheritance hierarchy.
// In header: <boost/type_index/runtime_cast/reference_cast.hpp> template<typename T, typename U> boost::add_reference< const T >::type runtime_cast(U const & u);
Template Parameters: |
|
||||
Returns: |
If there exists a valid conversion from U const& to T const, returns a T const that references an address suitably offset from u. If no such conversion exists, throws boost::typeindex::bad_runtime_cast. |