diff options
Diffstat (limited to 'entity')
-rw-r--r-- | entity/name-of.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/entity/name-of.hpp b/entity/name-of.hpp index 81feee19..42674a19 100644 --- a/entity/name-of.hpp +++ b/entity/name-of.hpp @@ -11,7 +11,14 @@ template<typename T> static constexpr auto mangled_name() { // NOLINT(bugprone-reserved-identifier) using namespace Corrade::Containers; using SVF = StringViewFlag; - return StringView { FM_PRETTY_FUNCTION, SVF::Global|SVF::NullTerminated }; + constexpr auto my_strlen = [](const char* str) constexpr -> size_t { + const char* start = str; + for (; *str; str++) + ; + return (size_t)(str - start); + }; + const char* str = FM_PRETTY_FUNCTION; + return StringView { str, my_strlen(str), SVF::Global|SVF::NullTerminated }; } template<typename T> constexpr inline auto name_of = mangled_name<T>(); |