CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
EnumIterator< T, start, stop > Class Template Reference

#include <enumiterator.h>

using difference_type = std::ptrdiff_t
 
using value_type = T
 
using pointer = std::add_pointer_t< value_type >
 
using reference = std::add_lvalue_reference_t< value_type >
 
using iterator_category = std::forward_iterator_tag
 
using const_reference = std::add_lvalue_reference_t< std::add_const_t< value_type > >
 
using const_pointer = std::add_pointer_t< std::add_const_t< value_type > >
 
 EnumIterator (T t)
 
 EnumIterator (const EnumIterator &)=default
 
 EnumIterator (EnumIterator &&)=default
 
EnumIteratoroperator= (const EnumIterator &)=default
 
EnumIteratoroperator= (EnumIterator &&)=default
 
bool operator== (EnumIterator rhs) const
 
bool operator!= (EnumIterator rhs) const
 
reference operator-> ()
 
const_reference operator-> () const
 
EnumIteratoroperator++ ()
 
EnumIterator operator++ (int) const
 
EnumIterator begin () const
 
EnumIterator end () const
 
reference operator* ()
 
const_reference operator* () const
 
void swap (EnumIterator &lhs, EnumIterator &rhs)
 

Detailed Description

template<class T, T start, T stop>
class EnumIterator< T, start, stop >

Iterator for an enum of type T that starts with an item start and ends after the item stop. Models ForwardIterator concept.

Warning
Following iterator DOES NOT WORK for non-contiguous enumerations like "enum class E { A = 100, B = 200, C == 300 }".
See also
http://en.cppreference.com/w/cpp/concept/ForwardIterator

Member Typedef Documentation

◆ const_pointer

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::const_pointer = std::add_pointer_t<std::add_const_t<value_type> >

◆ const_reference

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::const_reference = std::add_lvalue_reference_t<std::add_const_t<value_type> >

◆ difference_type

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::difference_type = std::ptrdiff_t

◆ iterator_category

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::iterator_category = std::forward_iterator_tag

◆ pointer

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::pointer = std::add_pointer_t<value_type>

◆ reference

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::reference = std::add_lvalue_reference_t<value_type>

◆ value_type

template<class T , T start, T stop>
using EnumIterator< T, start, stop >::value_type = T

Constructor & Destructor Documentation

◆ EnumIterator() [1/4]

template<class T , T start, T stop>
EnumIterator< T, start, stop >::EnumIterator ( )
default

Creates a singular iterator.

◆ EnumIterator() [2/4]

template<class T , T start, T stop>
EnumIterator< T, start, stop >::EnumIterator ( t)
inlineexplicit

◆ EnumIterator() [3/4]

template<class T , T start, T stop>
EnumIterator< T, start, stop >::EnumIterator ( const EnumIterator< T, start, stop > &  )
default

◆ EnumIterator() [4/4]

template<class T , T start, T stop>
EnumIterator< T, start, stop >::EnumIterator ( EnumIterator< T, start, stop > &&  )
default

◆ ~EnumIterator()

template<class T , T start, T stop>
EnumIterator< T, start, stop >::~EnumIterator ( )
default

Member Function Documentation

◆ begin()

template<class T , T start, T stop>
EnumIterator EnumIterator< T, start, stop >::begin ( ) const
inline

◆ end()

template<class T , T start, T stop>
EnumIterator EnumIterator< T, start, stop >::end ( ) const
inline

◆ operator!=()

template<class T , T start, T stop>
bool EnumIterator< T, start, stop >::operator!= ( EnumIterator< T, start, stop >  rhs) const
inline

◆ operator*() [1/2]

template<class T , T start, T stop>
reference EnumIterator< T, start, stop >::operator* ( )
inline

◆ operator*() [2/2]

template<class T , T start, T stop>
const_reference EnumIterator< T, start, stop >::operator* ( ) const
inline

◆ operator++() [1/2]

template<class T , T start, T stop>
EnumIterator & EnumIterator< T, start, stop >::operator++ ( )
inline

◆ operator++() [2/2]

template<class T , T start, T stop>
EnumIterator EnumIterator< T, start, stop >::operator++ ( int  ) const
inline

◆ operator->() [1/2]

template<class T , T start, T stop>
reference EnumIterator< T, start, stop >::operator-> ( )
inline

◆ operator->() [2/2]

template<class T , T start, T stop>
const_reference EnumIterator< T, start, stop >::operator-> ( ) const
inline

◆ operator=() [1/2]

template<class T , T start, T stop>
EnumIterator & EnumIterator< T, start, stop >::operator= ( const EnumIterator< T, start, stop > &  )
default

◆ operator=() [2/2]

template<class T , T start, T stop>
EnumIterator & EnumIterator< T, start, stop >::operator= ( EnumIterator< T, start, stop > &&  )
default

◆ operator==()

template<class T , T start, T stop>
bool EnumIterator< T, start, stop >::operator== ( EnumIterator< T, start, stop >  rhs) const
inline

Friends And Related Symbol Documentation

◆ swap

template<class T , T start, T stop>
void swap ( EnumIterator< T, start, stop > &  lhs,
EnumIterator< T, start, stop > &  rhs 
)
friend

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