ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::enumops::iterable Namespace Reference

Description:

Operators available to elements of enumerations if IterableTraits is specialized.

Note
This namespace exits only in the documentation to collect the operators. When parsed by a C++ compiler, the operators reside in the global namespace.

Function Index:

template<typename TEnum, typename TRhs = int>
requires ( alib::enumops::IsIterable<TEnum> && std::integral<TRhs> )
ALIB_EXPORT constexpr TEnum operator+ (TEnum element, TRhs summand) noexcept
 
template<typename TEnum, typename TRhs = int>
requires ( alib::enumops::IsIterable<TEnum> && std::integral<TRhs> )
ALIB_EXPORT constexpr TEnum operator- (TEnum element, typename std::underlying_type< TEnum >::type subtrahend) noexcept
 

Function Details:

◆ operator+()

template<typename TEnum, typename TRhs = int>
requires ( alib::enumops::IsIterable<TEnum> && std::integral<TRhs> )
ALIB_EXPORT constexpr TEnum alib::enumops::iterable::operator+ ( TEnum element,
TRhs summand )
constexprnoexcept

Add operator usable with scoped enum types and integral values.

Selected by the compiler only if IterableTraits is specialized for enum type TEnum.

Template Parameters
TEnumEnumeration type.
TRhsThe type of the summand.
Parameters
elementFirst operand of TEnum type.
summandThe summand.
Returns
The "summand-th" enum element after element .

Definition at line 114 of file iterable.inl.

◆ operator-()

template<typename TEnum, typename TRhs = int>
requires ( alib::enumops::IsIterable<TEnum> && std::integral<TRhs> )
ALIB_EXPORT constexpr TEnum alib::enumops::iterable::operator- ( TEnum element,
typename std::underlying_type< TEnum >::type subtrahend )
constexprnoexcept

Subtract operator usable with scoped enum types and integral values.

Selected by the compiler only if IterableTraits is specialized for enum type TEnum.

Template Parameters
TEnumEnumeration type.
TRhsThe type of the subtrahend.
Parameters
elementFirst operand of TEnum type.
subtrahendThe subtrahend.
Returns
The "subtrahend-th" enum element before element .

Definition at line 133 of file iterable.inl.