mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
fix #276
This commit is contained in:
parent
f2ddc4ba62
commit
1c94e914c2
1 changed files with 5 additions and 1 deletions
|
|
@ -469,8 +469,12 @@ constexpr auto n() noexcept {
|
|||
auto name = name_ptr ? str_view{name_ptr, std::char_traits<char>::length(name_ptr)} : str_view{};
|
||||
#elif defined(__clang__)
|
||||
auto name = str_view{__PRETTY_FUNCTION__ + 34, sizeof(__PRETTY_FUNCTION__) - 36};
|
||||
if (name.size_ > 22 && name.str_[0] == '(' && name.str_[1] == 'a' && name.str_[10] == ' ' && name.str_[22] == ':') {
|
||||
name.size_ -= 23;
|
||||
name.str_ += 23;
|
||||
}
|
||||
if (name.str_[0] == '(' || name.str_[0] == '-' || (name.str_[0] >= '0' && name.str_[0] <= '9')) {
|
||||
name = str_view{};;
|
||||
name = str_view{};
|
||||
}
|
||||
#elif defined(__GNUC__)
|
||||
auto name = str_view{__PRETTY_FUNCTION__, sizeof(__PRETTY_FUNCTION__) - 1};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue