1#ifndef VISTLE_ENUM_ARRAY_H
2#define VISTLE_ENUM_ARRAY_H
4#include <initializer_list>
8template<
typename T,
typename Enum>
11 typedef std::array<T, static_cast<int>(Enum::LastDummy)> ArrayType;
15 template<
typename... Args>
16 EnumArray(Args &&...args): m_array({std::forward<Args>(args)...})
18 inline T &
operator[](Enum e) {
return m_array[
static_cast<int>(e)]; }
19 inline const T &
operator[](Enum e)
const {
return m_array[
static_cast<int>(e)]; }
21 inline typename ArrayType::iterator
begin() {
return m_array.begin(); }
22 inline typename ArrayType::const_iterator
begin()
const {
return m_array.begin(); }
23 inline typename ArrayType::iterator
end() {
return m_array.end(); }
24 inline typename ArrayType::const_iterator
end()
const {
return m_array.end(); }
Definition: enumarray.h:9
EnumArray(Args &&...args)
Definition: enumarray.h:16
ArrayType::const_iterator begin() const
Definition: enumarray.h:22
ArrayType::iterator begin()
Definition: enumarray.h:21
ArrayType::iterator end()
Definition: enumarray.h:23
ArrayType::const_iterator end() const
Definition: enumarray.h:24
T & operator[](Enum e)
Definition: enumarray.h:18
const T & operator[](Enum e) const
Definition: enumarray.h:19
Definition: allobjects.cpp:30