mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
clean-up bitwise_operators
This commit is contained in:
parent
885b202dc6
commit
2b76827698
1 changed files with 3 additions and 3 deletions
|
|
@ -441,7 +441,7 @@ constexpr E& operator|=(E& lhs, E rhs) {
|
|||
static_assert(detail::check_enum_v<E, D>, "magic_enum::bitwise_operators::operator|= requires enum type.");
|
||||
using U = std::underlying_type_t<D>;
|
||||
|
||||
return lhs = static_cast<E>(static_cast<U>(lhs) | static_cast<U>(rhs));
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
|
||||
template <typename E, typename D = detail::enable_if_enum_t<E>>
|
||||
|
|
@ -449,7 +449,7 @@ constexpr E& operator&=(E& lhs, E rhs) {
|
|||
static_assert(detail::check_enum_v<E, D>, "magic_enum::bitwise_operators::operator%= requires enum type.");
|
||||
using U = std::underlying_type_t<D>;
|
||||
|
||||
return lhs = static_cast<E>(static_cast<U>(lhs) & static_cast<U>(rhs));
|
||||
return lhs = lhs & rhs;
|
||||
}
|
||||
|
||||
template <typename E, typename D = detail::enable_if_enum_t<E>>
|
||||
|
|
@ -457,7 +457,7 @@ constexpr E& operator^=(E& lhs, E rhs) {
|
|||
static_assert(detail::check_enum_v<E, D>, "magic_enum::bitwise_operators::operator^= requires enum type.");
|
||||
using U = std::underlying_type_t<D>;
|
||||
|
||||
return lhs = static_cast<E>(static_cast<U>(lhs) ^ static_cast<U>(rhs));
|
||||
return lhs = lhs ^ rhs;
|
||||
}
|
||||
|
||||
} // namespace magic_enum::bitwise_operators
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue