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

fix VS_2017_WORKAROUND for resharper

This commit is contained in:
neargye 2023-06-14 03:02:45 +04:00
parent fd15349e17
commit 911cd2047b

View file

@ -528,6 +528,10 @@ template <typename E, E V>
constexpr auto n() noexcept {
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};
std::size_t p = 0;
for (std::size_t i = name.size_; i > 0; --i) {
@ -544,6 +548,7 @@ constexpr auto n() noexcept {
name = str_view{};
}
return name;
# endif
}
#endif