WholeEnum< EnumType > Class Template Reference

#include <EnumIterator.h>

Inheritance diagram for WholeEnum< EnumType >:
Collaboration diagram for WholeEnum< EnumType >:

Public Types

typedef EnumIterator< EnumType > iterator
 
typedef ReverseEnumIterator< EnumType > reverse_iterator
 

Public Member Functions

 WholeEnum ()
 
iterator begin () const
 
iterator end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 

Detailed Description

template<typename EnumType>
class WholeEnum< EnumType >

Class expressing a continuous range of a whole enum for range-for expressions

Class for iterating all enum values, from EnumType::enumBegin_ up to, but not including, EnumType::enumEnd_.

This class requires that:

  • the underlying enum values be represented by continuous values of an integral type.
  • both enumBegin_ and enumEnd_ markers must be present as EnumType values;
  • enumBegin_ must have the same representation as the first element of the enum
  • enumEnd_ must have a representation that is one past the last user-accessible value of the enum.

Typical use:

enum class EnumType {
first_value = enumBegin_,
second_value,
};
for(auto enumvalue : WholeEnum<EnumType>()) {
do_stuff();
}

Definition at line 219 of file EnumIterator.h.

Member Typedef Documentation

◆ iterator

template<typename EnumType>
typedef EnumIterator<EnumType> EnumRangeT< EnumType >::iterator
inherited

Definition at line 158 of file EnumIterator.h.

◆ reverse_iterator

template<typename EnumType>
typedef ReverseEnumIterator<EnumType> EnumRangeT< EnumType >::reverse_iterator
inherited

Definition at line 159 of file EnumIterator.h.

Constructor & Destructor Documentation

◆ WholeEnum()

template<typename EnumType >
WholeEnum< EnumType >::WholeEnum ( )
inline

Definition at line 222 of file EnumIterator.h.

Member Function Documentation

◆ begin()

template<typename EnumType>
iterator EnumRangeT< EnumType >::begin ( ) const
inlineinherited

Definition at line 161 of file EnumIterator.h.

◆ end()

template<typename EnumType>
iterator EnumRangeT< EnumType >::end ( ) const
inlineinherited

Definition at line 162 of file EnumIterator.h.

◆ rbegin()

template<typename EnumType>
reverse_iterator EnumRangeT< EnumType >::rbegin ( ) const
inlineinherited

Definition at line 163 of file EnumIterator.h.

◆ rend()

template<typename EnumType>
reverse_iterator EnumRangeT< EnumType >::rend ( ) const
inlineinherited

Definition at line 164 of file EnumIterator.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors