3 ms·
This basically parse (at compile time) the __PRETTY_FUNCTION__ or equivalent in a function like template <typename Enum, Enum V> constexpr constexpr_string
by ogoffart 3y ago
This basically parse (at compile time) the __PRETTY_FUNCTION__ or equivalent in a function like
template <typename Enum, Enum V> constexpr constexpr_string enum_name() {...}
For all possible value of V from 0 to 256.
This is very compiler-specific as the actual value of __PRETTY_FUNCTION__ is different for each compiler, and even then, not really specified
(__PRETTY_FUNCTION__ is a builtin macro that expand to a string literal representing the function, for example "the_namespace::enum_name<day, day::Monday>()")
- MaulingMonkey 3y ago__PRETTY_FUNCTION__ isn't even guaranteed - on MSVC you'll need to resort to __FUNCSIG__ instead. Example for GCC/Clang/MSVC: https://wandbox.org/permlink/eMt6MxecI4VoJD9m https://wandbox.org/permlink/eMt6MxecI4VoJD9m
- bregma 3y ago__PRETTY_FUNCTION__ is a GCC extension that was copied by clang. It's not a standard language feature and won't work on something that is not GCC or mimics it closely.