1 #ifndef teca_bad_cast_h
2 #define teca_bad_cast_h
4 #include "teca_config.h"
20 teca_bad_cast(
const std::string &from,
const std::string &to);
22 const char* what()
const noexcept {
return m_what.c_str(); }
31 template <
typename class_t>
33 std::string safe_class_name(
const class_t &o)
35 return o ? std::string(o->get_class_name()) : std::string(
"nullptr");
38 template <
typename ptr_t>
40 std::string safe_pointer_name(
const ptr_t *o)
42 return std::string(
"pointer of type ") +
43 (o ? std::string(
typeid(o).name()) : std::string(
"nullptr"));
An exception that maybe thrown when a conversion between two data types fails.
Definition: teca_bad_cast.h:15
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.