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