MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ dynamic_type_name()

template<typename T >
std::string MayaFlux::Reflect::dynamic_type_name ( const T &  obj)
inlinenoexcept

Returns the demangled fully qualified dynamic type name of obj.

Allocates once per call via abi::__cxa_demangle on GCC/Clang. On MSVC typeid().name() is already human-readable. Intended for display and introspection paths, not hot loops.

Parameters
objAny polymorphic object.

Definition at line 75 of file TypeInfo.hpp.

76{
77 const char* mangled = typeid(obj).name();
78#if (defined(MAYAFLUX_COMPILER_CLANG) || defined(MAYAFLUX_COMPILER_GCC)) && !defined(MAYAFLUX_PLATFORM_WINDOWS)
79 int status {};
80 char* buf = abi::__cxa_demangle(mangled, nullptr, nullptr, &status);
81 std::string result = (status == 0 && buf) ? buf : mangled;
82 std::free(buf);
83 return result;
84#else
85 return mangled;
86#endif
87}

Referenced by short_dynamic_type_name().

+ Here is the caller graph for this function: