mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
fix VS_2017_WORKAROUND for resharper
This commit is contained in:
parent
fd15349e17
commit
911cd2047b
1 changed files with 5 additions and 0 deletions
|
|
@ -528,6 +528,10 @@ template <typename E, E V>
|
||||||
constexpr auto n() noexcept {
|
constexpr auto n() noexcept {
|
||||||
static_assert(is_enum_v<E>, "magic_enum::detail::n requires enum type.");
|
static_assert(is_enum_v<E>, "magic_enum::detail::n requires enum type.");
|
||||||
|
|
||||||
|
# if defined(MAGIC_ENUM_GET_ENUM_NAME_BUILTIN)
|
||||||
|
constexpr auto name_ptr = MAGIC_ENUM_GET_ENUM_NAME_BUILTIN(V);
|
||||||
|
auto name = name_ptr ? str_view{name_ptr, std::char_traits<char>::length(name_ptr)} : str_view{};
|
||||||
|
# else
|
||||||
str_view name = str_view{__FUNCSIG__, sizeof(__FUNCSIG__) - 17};
|
str_view name = str_view{__FUNCSIG__, sizeof(__FUNCSIG__) - 17};
|
||||||
std::size_t p = 0;
|
std::size_t p = 0;
|
||||||
for (std::size_t i = name.size_; i > 0; --i) {
|
for (std::size_t i = name.size_; i > 0; --i) {
|
||||||
|
|
@ -544,6 +548,7 @@ constexpr auto n() noexcept {
|
||||||
name = str_view{};
|
name = str_view{};
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue