10#ifndef TEUCHOS_DYN_CAST_HPP
11#define TEUCHOS_DYN_CAST_HPP
28class m_bad_cast :
public std::bad_cast {
31 explicit m_bad_cast(
const std::string& what_arg ) : msg(what_arg) {}
32 virtual ~m_bad_cast()
throw() {}
33 virtual const char* what()
const throw() {
return msg.data(); }
39 const std::string &T_from,
40 const std::string &T_from_concr,
41 const std::string &T_to
139template <
class T_To,
class T_From>
143 T_To *to_ =
dynamic_cast<T_To*
>(&from);
Defines basic traits returning the name of a type in a portable and readable way.
static std::string name()
std::string typeName(const T &t)
Template function for returning the concrete type name of a passed-in object.
T_To & dyn_cast(T_From &from)
Dynamic casting utility function meant to replace dynamic_cast<T&> by throwing a better documented er...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
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)