Skip to content

Commit 0f3c0c2

Browse files
authored
Merge pull request #234 from qicosmos/fix_type_string
2 parents bc44256 + 84f8cbf commit 0f3c0c2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

iguana/enum_reflection.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ inline constexpr std::string_view type_string() {
3535
constexpr std::string_view str = get_raw_name<T>();
3636
constexpr auto next1 = str.rfind(sample[pos + 3]);
3737
#if defined(_MSC_VER)
38-
constexpr auto s1 = str.substr(pos + 6, next1 - pos - 6);
38+
constexpr std::size_t npos = str.find_first_of(" ", pos);
39+
if (npos != std::string_view::npos)
40+
return str.substr(npos + 1, next1 - npos - 1);
41+
else
42+
return str.substr(pos, next1 - pos);
3943
#else
40-
constexpr auto s1 = str.substr(pos, next1 - pos);
44+
return str.substr(pos, next1 - pos);
4145
#endif
42-
return s1;
4346
}
4447

4548
template <auto T>

0 commit comments

Comments
 (0)