diff --git a/iterator/iota.hpp b/iterator/iota.hpp index 4ade8e1f..9da177f0 100644 --- a/iterator/iota.hpp +++ b/iterator/iota.hpp @@ -24,24 +24,6 @@ namespace cruft::iterator { template class iota { public: - class iterator; - - using value_type = ValueT; - using reference = ValueT&; - using const_reference = ValueT const&; - using const_iterator = iterator; - using iterator = iterator; - using difference_type = ssize_t; - using size_type = size_t; - - iota () - : m_total {} - { ; } - - iota (value_type _total) - : m_total (_total) - { ; } - class iterator { public: using iterator_category = std::random_access_iterator_tag; @@ -51,11 +33,11 @@ namespace cruft::iterator { using reference = value_type&; explicit iterator () - : m_value {} + : m_value {} { ; } explicit iterator (value_type _value) - : m_value (_value) + : m_value (_value) { ; } pointer operator-> () const& noexcept { return &m_value; } @@ -78,6 +60,22 @@ namespace cruft::iterator { ValueT m_value; }; + using value_type = ValueT; + using reference = ValueT&; + using const_reference = ValueT const&; + using const_iterator = iterator; + using iterator = iterator; + using difference_type = ssize_t; + using size_type = size_t; + + iota () + : m_total {} + { ; } + + iota (value_type _total) + : m_total (_total) + { ; } + iterator begin (void) const { return iterator {}; } iterator end (void) const { return iterator {m_total}; }