3 #ifndef DUNE_CLASSNAME_HH
4 #define DUNE_CLASSNAME_HH
15 #include <type_traits>
19 #endif // #if HAVE_CXA_DEMANGLE
25 inline std::string demangle(std::string name)
29 std::unique_ptr<char, void(*)(
void*)>
30 demangled(abi::__cxa_demangle(name.c_str(),
nullptr,
nullptr, &status),
33 name = demangled.get();
34 #endif // #if HAVE_CXA_DEMANGLE
46 typedef typename std::remove_reference<T>::type TR;
47 std::string
className = Impl::demangle(
typeid( TR ).name() );
48 if (std::is_const<TR>::value)
50 if (std::is_volatile<TR>::value)
52 if (std::is_lvalue_reference<T>::value)
54 else if (std::is_rvalue_reference<T>::value)
66 typedef typename std::remove_reference<T>::type TR;
67 std::string
className = Impl::demangle(
typeid(v).name() );
68 if (std::is_const<TR>::value)
70 if (std::is_volatile<TR>::value)
76 #endif // DUNE_CLASSNAME_HH