ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::enumops::IterableTraits< TEnum > Struct Template Reference

Description:

template<typename TEnum>
requires std::is_enum_v<TEnum>
struct alib::enumops::IterableTraits< TEnum >

A simple type trait that - if specialized - enables standard and range-based C++ iteration of the elements of an enumeration. Specializations have to declare constexpr fields Begin and End, as documented with this type.

Note
The unspecialized version of this struct is empty.

If specialized, the following entities become available:

Attention
Likewise with the operators introduced with other type traits of this module, this documentation "fakes" the operators into namespace alib::enumops::iterable, while in fact they are defined in the global namespace!
See corresponding note in the Programmer's Manual for details.

Restrictions
For technical reasons, this concept is not applicable to enum types that are defined as private or protected inner types of structs or classes.

See also
Template Parameters
TEnumThe enum type to enable iteration for.

Definition at line 52 of file iterable.inl.

Inheritance diagram for alib::enumops::IterableTraits< TEnum >:
[legend]
Collaboration diagram for alib::enumops::IterableTraits< TEnum >:
[legend]

Public Static Field Index:

static constexpr TEnum Begin
 
static constexpr TEnum End
 

Field Details:

◆ Begin

template<typename TEnum>
TEnum alib::enumops::IterableTraits< TEnum >::Begin
staticconstexpr

Specializations have to implement this static method to return the first enum element of the iteration.

Returns
The first enumeration element.

Definition at line 59 of file iterable.inl.

◆ End

template<typename TEnum>
TEnum alib::enumops::IterableTraits< TEnum >::End
staticconstexpr

Specializations have to implement this static method to return the element value after the last enum element of the iteration.

Returns
The element after the last enumeration element.

Definition at line 67 of file iterable.inl.


The documentation for this struct was generated from the following file: