From d351531abc5cb0c9cd9465604207015f9c3472eb Mon Sep 17 00:00:00 2001 From: metabeyond Date: Thu, 14 Nov 2024 22:26:50 +0800 Subject: [PATCH] Fixed enum parse issue. --- include/essence/meta/enum.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/essence/meta/enum.hpp b/include/essence/meta/enum.hpp index 9a9f47f..5ed943d 100644 --- a/include/essence/meta/enum.hpp +++ b/include/essence/meta/enum.hpp @@ -56,12 +56,19 @@ namespace essence::meta { constexpr auto min = range.first; constexpr auto max = range.second; + struct dummy { + static constexpr auto copy(std::string_view str) noexcept { + // ReSharper disable once CppDFALocalValueEscapesFunction + return str; + } + }; + auto origin = [&](std::index_sequence) -> generator> { - (co_yield std::pair{get_literal_string_v(min + Is), + (co_yield std::pair{dummy::copy(get_literal_string_v(min + Is), identifier_param{ .shortened = Short, .ensure_correctness = false, - }>(), + }>()), static_cast(min + Is)}, ...); }(std::make_index_sequence{});