From 2c51f2caa6ffe1334670d8c43b919f8dc4abb98a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 18 Nov 2022 10:21:17 +0100 Subject: make the mangled name from `name_of` shorter --- src/entity.hpp | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/entity.hpp b/src/entity.hpp index b1211d0b..0f7ccbe0 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -16,14 +16,15 @@ #define FM_PRETTY_FUNCTION __PRETTY_FUNCTION__ #endif -namespace floormat::entities::detail { -template static constexpr StringView type_name(); -template struct type_name_helper; +template +static constexpr auto _name_of() { + using namespace Corrade::Containers; + using SVF = StringViewFlag; + constexpr const char* str = FM_PRETTY_FUNCTION; + return StringView { str, Implementation::strlen_(str), SVF::Global|SVF::NullTerminated }; } -namespace floormat { -template constexpr inline StringView name_of = entities::detail::type_name_helper::name; -} // namespace floormat +template constexpr inline Corrade::Containers::StringView name_of = _name_of(); namespace floormat::entities { @@ -82,20 +83,6 @@ concept FieldWriter = requires { namespace detail { -template -static constexpr StringView type_name() { - using namespace Corrade::Containers; - using SVF = StringViewFlag; - constexpr const char* str = FM_PRETTY_FUNCTION; - return StringView { str, Implementation::strlen_(str), SVF::Global|SVF::NullTerminated }; -} - -template -struct type_name_helper final -{ - static constexpr const StringView name = type_name(); -}; - template R> struct read_field { static constexpr Type read(const Obj& x, R r) { return r(x); } -- cgit v1.2.3