4#ifndef _3608ae00_0c4a_4bb2_a439_7094206b302f
5#define _3608ae00_0c4a_4bb2_a439_7094206b302f
19 : _counter(0), _container()
33 return this->_container;
40 this->_counter.
reset();
48 return this->_counter.
index();
52 typename T::value_type
const &
item()
const
54 return this->_container[this->_counter.
index()];
58 std::size_t
end()
const
60 return this->_counter.
end();
66 this->_counter.
reset();
83 return this->_counter.
first();
89 return this->_counter.
last();
95 return this->_counter.
done();
121 typename T::value_type &
item()
123 return this->_container[this->_counter.index()];
Read-only iterator to a container.
Definition Iterator.h:15
std::size_t end() const
Return the end value.
Definition Iterator.h:58
T const & container() const
Return the container.
Definition Iterator.h:31
bool first() const
Test if the index is 0.
Definition Iterator.h:81
ConstIterator< T > & operator=(ConstIterator< T > &&)=default
bool last() const
Test if the index is equal to end-1.
Definition Iterator.h:87
ConstIterator & reset()
Reset the iterator to the start of the container.
Definition Iterator.h:64
T::value_type const & item() const
Return the current item.
Definition Iterator.h:52
void setContainer(T const &container)
Set the container, reset the counter.
Definition Iterator.h:37
ConstIterator & operator++()
Move to the next element.
Definition Iterator.h:74
ConstIterator(ConstIterator< T > &&)=default
ConstIterator(ConstIterator< T > const &)=default
virtual ~ConstIterator()=default
ConstIterator< T > & operator=(ConstIterator< T > const &)=default
ConstIterator(T const &container={})
Create an iterator at the beginning of a container.
Definition Iterator.h:18
bool done() const
Test if the index is equal to end.
Definition Iterator.h:93
std::size_t index() const
Return the current index.
Definition Iterator.h:46
Counter from 0 (included) to end (excluded).
Definition Counter.h:14
bool last() const
Test if the index is equal to end-1.
bool done() const
Test if the index is equal to end.
Counter & reset()
Set the index to 0.
Counter & setEnd(std::size_t end)
Set the end value.
std::size_t end() const
Return the end value.
bool first() const
Test if the index is 0.
std::size_t index() const
Return the current index.
Read/write iterator to a container.
Definition Iterator.h:106
Iterator< T > & operator=(Iterator< T > &&)=default
Iterator(Iterator< T > const &)=default
Iterator< T > & operator=(Iterator< T > const &)=default
Iterator(T const &container={})
Create an iterator at the beginning of a container.
Definition Iterator.h:109
T::value_type & item()
Return the current item.
Definition Iterator.h:121
Iterator(Iterator< T > &&)=default
Top-level namespace of the msl library.
Definition acceleration.h:17