42 #ifndef TEUCHOS_DYN_CAST_HPP 43 #define TEUCHOS_DYN_CAST_HPP 63 explicit m_bad_cast(
const std::string& what_arg ) : msg(what_arg) {}
65 virtual const char* what()
const throw() {
return msg.data(); }
71 const std::string &T_from,
72 const std::string &T_from_concr,
73 const std::string &T_to
171 template <
class T_To,
class T_From>
175 T_To *to_ =
dynamic_cast<T_To*
>(&from);
189 #endif // TEUCHOS_DYN_CAST_HPP T_To & dyn_cast(T_From &from)
Dynamic casting utility function meant to replace dynamic_cast<T&> by throwing a better documented er...
Exception class for bad cast.
Default traits class that just returns typeid(T).name().
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
Defines basic traits returning the name of a type in a portable and readable way. ...
std::string typeName(const T &t)
Template function for returning the concrete type name of a passed-in object.
TEUCHOSCORE_LIB_DLL_EXPORT void dyn_cast_throw_exception(const std::string &T_from, const std::string &T_from_concr, const std::string &T_to)