20 #ifndef INCLUDED_O3TL_ENUMARRAY_HXX
21 #define INCLUDED_O3TL_ENUMARRAY_HXX
24 #include <type_traits>
44 template<
typename E,
typename V>
56 static const size_type
max_index =
static_cast<size_type
>(E::LAST);
60 assert(index>=static_cast<E>(0) && index<=E::LAST);
66 assert(index>=static_cast<E>(0) && index<=E::LAST);
73 static size_type
size() {
return max_index + 1; }
96 typename std::make_signed<
97 typename std::underlying_type<typename EA::key_type>::type>::type
103 : m_buf(&b), m_pos(start_pos) {}
111 template<
typename EA>
112 class enumarray_const_iterator {
121 typename std::make_signed<
122 typename std::underlying_type<typename EA::key_type>::type>::type
124 typedef typename EA::value_type
const *
pointer;
128 : m_buf(&b), m_pos(start_pos) {}
EA::value_type value_type
std::bidirectional_iterator_tag iterator_category
std::bidirectional_iterator_tag iterator_category
This is a container convenience class for arrays indexed by enum values.
std::make_signed< typename std::underlying_type< typename EA::key_type >::type >::type difference_type
const_iterator end() const
enumarray_const_iterator< self_type > const_iterator
enumarray_const_iterator< EA > self_type
const_iterator begin() const
const V & operator[](E index) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool operator==(self_type const &other) const
EA::value_type & reference
V detail_values[max_index+1]
bool operator!=(self_type const &other) const
value_type & operator*() const
enumarray_const_iterator(EA const &b, size_t start_pos)
bool operator!=(self_type const &other) const
EA::value_type const * pointer
value_type * operator->() const
enumarray_iterator< self_type > iterator
enumarray< E, V > self_type
enumarray_iterator(EA &b, size_t start_pos)
enumarray_iterator< EA > self_type
static const size_type max_index
EA::value_type const value_type
std::make_signed< typename std::underlying_type< typename EA::key_type >::type >::type difference_type
bool operator==(self_type const &other) const
value_type * operator->() const
EA::value_type const & reference
value_type & operator*() const