Simple TMP struct 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.
If specialized, the following entities become available:
alib::enums::iterable
, while in fact they are defined in the global namespace!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.
TEnum | The enum type to enable iteration for. |
TEnableIf | This parameter has a default expressions and must not be provided with specializations of this struct. It is used to ensure that template parameter TEnum is an enumeration type. |
Definition at line 66 of file iterable.hpp.
#include <iterable.hpp>
Public Static Field Index: | |
static constexpr TEnum | Begin |
static constexpr TEnum | End |
|
staticconstexpr |
Specializations have to implement this static method to return the first enum element of the iteration.
Definition at line 73 of file iterable.hpp.
|
staticconstexpr |
Specializations have to implement this static method to return the element value after the last enum element of the iteration.
Definition at line 81 of file iterable.hpp.