1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00
This commit is contained in:
neargye 2022-08-08 21:07:05 +04:00
parent 95641a8f78
commit 13ba445e9c

View file

@ -451,10 +451,10 @@ struct is_valid : std::bool_constant<valid<E, static_cast<E>(V)>()> {};
template <typename E, int O, bool IsFlags, typename U = std::underlying_type_t<E>>
constexpr U ualue(std::size_t i) noexcept {
static_assert(is_enum_v<E>, "magic_enum::detail::value requires enum type.");
static_assert(is_enum_v<E>, "magic_enum::detail::ualue requires enum type.");
if constexpr (std::is_same_v<U, bool>) { // bool special case
static_assert(O == 0, "magic_enum::detail::value requires valid offset.");
static_assert(O == 0, "magic_enum::detail::ualue requires valid offset.");
return static_cast<U>(i);
} else if constexpr (IsFlags) {