This class implements an iterator that returns the same value everywhere. More...
#include <array.hpp>
Public Types | |
typedef std::random_access_iterator_tag | iterator_category |
typedef value_type_ | value_type |
typedef ptrdiff_t | difference_type |
typedef const value_type_ * | pointer |
typedef const value_type_ & | reference |
Public Member Functions | |
LITE_INLINE | c_iterator (const value_type &value) |
Construct a c_iterator that returns value everywhere. | |
LITE_INLINE | c_iterator (const c_iterator &other) |
template<class other_value_type_ > | |
LITE_INLINE | c_iterator (const c_iterator< other_value_type_ > &other) |
LITE_INLINE c_iterator & | operator= (const c_iterator &other) |
template<class other_value_type_ > | |
LITE_INLINE c_iterator & | operator= (const c_iterator< other_value_type_ > &other) |
Public Attributes | |
value_type | value |
This variable stores the value that is returned by c_iterator. |
This class implements an iterator that returns the same value everywhere.
The value can be specified as a constructor argument.
c_iterator<float> it(1.5f);
std::cout << at(it) << std::endl;
std::cout << at(it, 2, 3, 4) << std::endl;
shift<2>(it, -5);
std::cout << at(it, 2, 3, 4) << std::endl;
typedef array<float[2][2], default_traits_type, reference_rep<c_iterator<float> > A;
A a(it, A::size_type());
std::cout << a << std::endl;
The output would be:
1.5 1.5 1.5 1.5 1.5 1.5 1.5