ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
T_EnumIsIterable< TEnum, TEnableIf > Struct Template Reference

Description:

template<typename TEnum, typename TEnableIf = typename std::enable_if<std::is_enum<TEnum>::value>::type>
struct alib::enums::T_EnumIsIterable< TEnum, TEnableIf >

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.

Note
The unspecialized version of this struct is empty.

If specialized, the following entities become available:

Attention
Likewise with the operators introduced with other TMP structs of this module, this documentation "fakes" the operators into namespace alib::enums::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.
TEnableIfThis 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>

Inheritance diagram for T_EnumIsIterable< TEnum, TEnableIf >:
[legend]
Collaboration diagram for T_EnumIsIterable< TEnum, TEnableIf >:
[legend]

Public Static Field Index:

static constexpr TEnum Begin
 
static constexpr TEnum End
 

Field Details:

◆ Begin

template<typename TEnum , typename TEnableIf = typename std::enable_if<std::is_enum<TEnum>::value>::type>
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 73 of file iterable.hpp.

◆ End

template<typename TEnum , typename TEnableIf = typename std::enable_if<std::is_enum<TEnum>::value>::type>
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 81 of file iterable.hpp.


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