From 84f8cbfaa18bff104baac3a47dc52b5df0ce663a Mon Sep 17 00:00:00 2001 From: qicosmos Date: Wed, 20 Dec 2023 11:03:17 +0800 Subject: [PATCH] fix --- iguana/enum_reflection.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iguana/enum_reflection.hpp b/iguana/enum_reflection.hpp index 5b96c52a..9b871f8c 100644 --- a/iguana/enum_reflection.hpp +++ b/iguana/enum_reflection.hpp @@ -35,11 +35,14 @@ inline constexpr std::string_view type_string() { constexpr std::string_view str = get_raw_name(); constexpr auto next1 = str.rfind(sample[pos + 3]); #if defined(_MSC_VER) - constexpr auto s1 = str.substr(pos + 6, next1 - pos - 6); + constexpr std::size_t npos = str.find_first_of(" ", pos); + if (npos != std::string_view::npos) + return str.substr(npos + 1, next1 - npos - 1); + else + return str.substr(pos, next1 - pos); #else - constexpr auto s1 = str.substr(pos, next1 - pos); + return str.substr(pos, next1 - pos); #endif - return s1; } template