15 #ifndef __Thea_Common_hpp__ 16 #define __Thea_Common_hpp__ 19 #include "AtomicInt32.hpp" 20 #include "CommonEnums.hpp" 21 #include "EnumClass.hpp" 25 #include "Noncopyable.hpp" 26 #include "NumericType.hpp" 35 #if defined(__GNUC__) && __GNUC__ >= 3 37 # define THEA_HAVE_CXA_DEMANGLE 43 # define THEA_EXPORT_INSTANTIATION 50 template <
typename CondT,
typename MessageT>
54 #ifdef THEA_DEBUG_BUILD 57 std::cerr <<
"!!! Debug-mode assertion failed !!! " << msg << std::endl;
64 template <
typename CondT,
typename MessageT>
70 std::cerr <<
"!!! Assertion failed !!! " << msg << std::endl;
76 #ifdef THEA_HAVE_CXA_DEMANGLE 78 namespace CommonInternal {
81 demangle(
char const * class_name)
86 char * ret = abi::__cxa_demangle(class_name,
nullptr, &length, &status);
89 std::string result(ret);
102 #endif // THEA_HAVE_CXA_DEMANGLE 105 template <
typename T>
109 #ifdef THEA_HAVE_CXA_DEMANGLE 110 return CommonInternal::demangle(
typeid(T).name());
112 return typeid(T).name();
117 template <
typename T>
121 #ifdef THEA_HAVE_CXA_DEMANGLE 122 return CommonInternal::demangle(
typeid(obj).name());
124 return typeid(obj).name();
131 #include "StringAlg.hpp" std::string getTypeName()
Get the name of a type, ignoring reference and cv-qualifiers.
Root namespace for the Thea library.
void alwaysAssertM(CondT const &test, MessageT const &msg)
Check if a test condition is true, and immediately abort the program with an error code if not...
void debugAssertM(CondT const &test, MessageT const &msg)
Check if a test condition is true, and immediately abort the program with an error code if not...