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:
parent
4a862c932e
commit
43070070e6
2 changed files with 43 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue