69template<
typename TEnum>
70requires std::is_enum<TEnum>::value
78template<
typename TEnum>
117template<
typename TEnum>
119constexpr TEnum
operator& (TEnum lhs, TEnum rhs)
noexcept
121 using TBits=
typename std::underlying_type<TEnum>::type;
122 return TEnum(TBits(lhs) & TBits(rhs));
134template<
typename TEnum>
138 using TBits=
typename std::underlying_type<TEnum>::type;
139 return lhs= TEnum( TBits(lhs) & TBits(rhs) );
151template<
typename TEnum>
153constexpr TEnum
operator| (TEnum lhs, TEnum rhs)
noexcept
155 using TBits=
typename std::underlying_type<TEnum>::type;
156 return TEnum(TBits(lhs) | TBits(rhs));
168template<
typename TEnum>
172 using TBits=
typename std::underlying_type<TEnum>::type;
173 return lhs= TEnum( TBits(lhs) | TBits(rhs) );
185template<
typename TEnum>
187constexpr TEnum
operator^ (TEnum lhs, TEnum rhs)
noexcept
189 using TBits=
typename std::underlying_type<TEnum>::type;
190 return TEnum(TBits(lhs) ^ TBits(rhs));
202template<
typename TEnum>
206 using TBits=
typename std::underlying_type<TEnum>::type;
207 return lhs= TEnum( TBits(lhs) ^ TBits(rhs) );
222template<
typename TEnum>
226 using TBits=
typename std::underlying_type<TEnum>::type;
227 return TEnum( ~ TBits(op) );
242template<
typename TEnum>
243requires ( alib::enumops::IsBitwise <TEnum>
245constexpr TEnum
operator+ (TEnum lhs, TEnum rhs)
noexcept
247 using TBits=
typename std::underlying_type<TEnum>::type;
248 return TEnum(TBits(lhs) | TBits(rhs));
262template<
typename TEnum>
263requires ( alib::enumops::IsBitwise <TEnum>
265constexpr TEnum
operator+= (TEnum& lhs, TEnum rhs)
noexcept
267 using TBits=
typename std::underlying_type<TEnum>::type;
268 return lhs= TEnum( TBits(lhs) | TBits(rhs) );
285template<
typename TEnum>
286requires ( alib::enumops::IsBitwise <TEnum>
288constexpr TEnum
operator- (TEnum lhs, TEnum rhs)
noexcept
290 using TBits=
typename std::underlying_type<TEnum>::type;
291 return TEnum( TBits(lhs) & (~TBits(rhs)) );
308template<
typename TEnum>
309requires ( alib::enumops::IsBitwise <TEnum>
311constexpr TEnum
operator-= (TEnum& lhs, TEnum rhs)
noexcept
313 using TBits=
typename std::underlying_type<TEnum>::type;
314 return lhs= TEnum( TBits(lhs) & (~TBits(rhs)) );
334template<
typename TEnum>
336constexpr bool HasBits(TEnum element, TEnum selection)
noexcept
338 using TBits=
typename std::underlying_type<TEnum>::type;
339 return ( TBits(element) & TBits(selection) ) == TBits(selection);
355template<
typename TEnum>
357constexpr bool HasOneOf(TEnum element, TEnum selection)
noexcept
359 using TBits=
typename std::underlying_type<TEnum>::type;
360 return ( TBits(element) & TBits(selection) ) != TBits(0);
371template<
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)