#pragma once #include namespace scwx { namespace util { template class Iterator { typedef typename std::underlying_type::type value_t; int value_; public: Iterator(const T& v) : value_(static_cast(v)) {} Iterator() : value_(static_cast(beginValue)) {} Iterator operator++() { ++value_; return *this; } T operator*() { return static_cast(value_); } Iterator begin() { return *this; } // Default constructor Iterator end() { static const Iterator endIterator = ++Iterator(endValue); return endIterator; } bool operator!=(const Iterator& i) { return value_ != i.value_; } }; } // namespace util } // namespace scwx