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

fix enum name in namespace

This commit is contained in:
neargye 2023-05-30 14:37:45 +04:00
parent 6fec6f6386
commit 6fe7ffbf35
2 changed files with 70 additions and 4 deletions

View file

@ -501,13 +501,16 @@ constexpr auto n() noexcept {
name.size_ -= (prefix + 2);
name.str_ += (prefix + 2);
}
std::size_t p = 0;
for (std::size_t i = 0; i < name.size_; ++i) {
if (name.str_[i] == ':') {
name.size_ -= (i + 2);
name.str_ += (i + 2);
break;
p = i + 1;
}
}
if (p > 0) {
name.size_ -= p;
name.str_ += p;
}
return name;
} else {
return str_view{}; // Unsupported compiler or Invalid customize.