1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

fix enum_type_name in namespace

This commit is contained in:
neargye 2023-06-21 12:45:59 +04:00
parent 4a862c932e
commit 43070070e6
2 changed files with 43 additions and 0 deletions

View file

@ -438,6 +438,17 @@ constexpr auto n() noexcept {
#else
auto name = str_view{};
#endif
std::size_t p = 0;
for (std::size_t i = name.size_; i > 0; --i) {
if (name.str_[i] == ':') {
p = i + 1;
break;
}
}
if (p > 0) {
name.size_ -= p;
name.str_ += p;
}
return name;
} else {
return str_view{}; // Unsupported compiler or Invalid customize.