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

◆ live_type_name()

template<typename T >
constexpr std::string_view MayaFlux::internal::live_type_name ( )
constexprnoexcept

Extracts the unqualified type name from a compiler-generated function signature.

Parses PRETTY_FUNCTION to extract the final component of a fully qualified type name. Used by MF_LIVE_EXPOSE_AUTO to derive stable per-type key prefixes without requiring the caller to supply a string literal.

Template Parameters
TType to name.
Returns
string_view into static storage valid for the process lifetime.

Definition at line 206 of file LiveArena.hpp.

207 {
208 std::string_view sv = MF_PRETTY_FUNCTION;
209 auto eq = sv.find("T = ");
210 auto end = sv.find(';', eq);
211 if (end == std::string_view::npos) {
212 end = sv.rfind(']');
213 }
214 if (eq == std::string_view::npos || end == std::string_view::npos) {
215 return sv;
216 }
217 sv = sv.substr(eq + 4, end - eq - 4);
218 auto colon = sv.rfind(':');
219 if (colon == std::string_view::npos) {
220 return sv;
221 }
222 return sv.substr(colon + 1);
223 }
#define MF_PRETTY_FUNCTION
Definition LiveArena.hpp:10

References MF_PRETTY_FUNCTION.