From 2f8d7643d03f39fa848576692264d0fe3a37ed91 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 6 Nov 2023 20:48:33 +0000 Subject: Reformat with new clang-format --- lib/enumDetails.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/enumDetails.h') diff --git a/lib/enumDetails.h b/lib/enumDetails.h index 5966be2..b6ff046 100644 --- a/lib/enumDetails.h +++ b/lib/enumDetails.h @@ -26,11 +26,13 @@ template struct EnumTypeDetails : EnumDetailsBase { protected: #endif constexpr static std::string_view SEARCH_TYPE {"E = "}; + constexpr static auto typeraw() { return std::string_view {__PRETTY_FUNCTION__}; }; + constexpr static auto typeNameStart {typeraw().find(SEARCH_TYPE) + SEARCH_TYPE.length()}; constexpr static auto typeNameEnd {typeraw().find_first_of("];", typeNameStart)}; constexpr static auto typeNameLen {typeNameEnd - typeNameStart}; @@ -47,11 +49,13 @@ template struct EnumValueDetails : public EnumTypeDetails; + constexpr static auto raw() { return std::string_view {__PRETTY_FUNCTION__}; }; + constexpr static auto nameStart {raw().find_last_of(": ") + 1}; constexpr static auto nameEnd {raw().find_first_of("];", nameStart)}; constexpr static auto nameLen {nameEnd - nameStart}; @@ -84,12 +88,14 @@ private: return std::array {EnumValueDetails(n)>::valid...}; #pragma GCC diagnostic pop } + template constexpr static auto get_values(std::integer_sequence) { return std::array {EnumValueDetails(n)>::raw_value...}; } + template constexpr static auto get_valueNames(std::integer_sequence) -- cgit v1.2.3