69template<
typename TEnum>
70requires std::is_enum<TEnum>::value
78template<
typename TEnum>
117template<
typename TEnum>
119constexpr TEnum
operator& (TEnum lhs, TEnum rhs)
noexcept {
120 using TBits=
typename std::underlying_type<TEnum>::type;
121 return TEnum(TBits(lhs) & TBits(rhs));
133template<
typename TEnum>
136 using TBits=
typename std::underlying_type<TEnum>::type;
137 return lhs= TEnum( TBits(lhs) & TBits(rhs) );
149template<
typename TEnum>
151constexpr TEnum
operator| (TEnum lhs, TEnum rhs)
noexcept {
152 using TBits=
typename std::underlying_type<TEnum>::type;
153 return TEnum(TBits(lhs) | TBits(rhs));
165template<
typename TEnum>
168 using TBits=
typename std::underlying_type<TEnum>::type;
169 return lhs= TEnum( TBits(lhs) | TBits(rhs) );
181template<
typename TEnum>
183constexpr TEnum
operator^ (TEnum lhs, TEnum rhs)
noexcept {
184 using TBits=
typename std::underlying_type<TEnum>::type;
185 return TEnum(TBits(lhs) ^ TBits(rhs));
197template<
typename TEnum>
200 using TBits=
typename std::underlying_type<TEnum>::type;
201 return lhs= TEnum( TBits(lhs) ^ TBits(rhs) );
216template<
typename TEnum>
219 using TBits=
typename std::underlying_type<TEnum>::type;
220 return TEnum( ~ TBits(op) );
235template<
typename TEnum>
236requires ( alib::enumops::IsBitwise <TEnum>
238constexpr TEnum
operator+ (TEnum lhs, TEnum rhs)
noexcept {
239 using TBits=
typename std::underlying_type<TEnum>::type;
240 return TEnum(TBits(lhs) | TBits(rhs));
254template<
typename TEnum>
255requires ( alib::enumops::IsBitwise <TEnum>
257constexpr TEnum
operator+= (TEnum& lhs, TEnum rhs)
noexcept {
258 using TBits=
typename std::underlying_type<TEnum>::type;
259 return lhs= TEnum( TBits(lhs) | TBits(rhs) );
276template<
typename TEnum>
277requires ( alib::enumops::IsBitwise <TEnum>
279constexpr TEnum
operator- (TEnum lhs, TEnum rhs)
noexcept {
280 using TBits=
typename std::underlying_type<TEnum>::type;
281 return TEnum( TBits(lhs) & (~TBits(rhs)) );
298template<
typename TEnum>
299requires ( alib::enumops::IsBitwise <TEnum>
301constexpr TEnum
operator-= (TEnum& lhs, TEnum rhs)
noexcept {
302 using TBits=
typename std::underlying_type<TEnum>::type;
303 return lhs= TEnum( TBits(lhs) & (~TBits(rhs)) );
323template<
typename TEnum>
325constexpr bool HasBits(TEnum element, TEnum selection)
noexcept {
326 using TBits=
typename std::underlying_type<TEnum>::type;
327 return ( TBits(element) & TBits(selection) ) == TBits(selection);
343template<
typename TEnum>
345constexpr bool HasOneOf(TEnum element, TEnum selection)
noexcept {
346 using TBits=
typename std::underlying_type<TEnum>::type;
347 return ( TBits(element) & TBits(selection) ) != TBits(0);
358template<
typename TEnum>
#define ALIB_WARNINGS_RESTORE
#define ALIB_WARNINGS_IGNORE_DOCS
ALIB_EXPORT constexpr TEnum operator&=(TEnum &lhs, TEnum rhs) noexcept
ALIB_EXPORT constexpr TEnum operator^(TEnum lhs, TEnum rhs) noexcept
constexpr int CountElements(TEnum value)
ALIB_EXPORT constexpr TEnum operator|=(TEnum &lhs, TEnum rhs) noexcept
ALIB_EXPORT constexpr TEnum operator^=(TEnum &lhs, TEnum rhs) noexcept
constexpr bool HasOneOf(TEnum element, TEnum selection) noexcept
ALIB_EXPORT constexpr TEnum operator~(TEnum op) noexcept
ALIB_EXPORT constexpr TEnum operator&(TEnum lhs, TEnum rhs) noexcept
constexpr bool HasBits(TEnum element, TEnum selection) noexcept
ALIB_EXPORT constexpr TEnum operator|(TEnum lhs, TEnum rhs) noexcept
std::underlying_type_t< TEnum > constexpr UnderlyingIntegral(TEnum element) noexcept
constexpr int BitCount(TIntegral value)