#include <rangelib/iterator_range.hpp>

| I | The iterator type | |
| T | The iterator range traits, used to deduce the Range's iterator, const_iterator, reference, const_reference and value_type |
It could be used as follows
template<typename I> void dump_elements(I from, I to) { for(iterator_range<I> r(from, to); r; ++r) { std::cout << &r; // Dump the current value to stdout } }
Notional Range methods | |
| bool | is_open () const |
| Indicates whether the range is open. | |
| reference | current () |
| Returns the current value in the range. | |
| const_reference | current () const |
| Returns the current value in the range. | |
| operator boolean_type () const | |
| Indicates whether the range is open. | |
| reference | operator* () |
| Returns the current value in the range. | |
| const_reference | operator* () const |
| Returns the current value in the range. | |
| class_type & | advance () |
| Advances the current position in the range. | |
| class_type & | operator++ () |
| Advances the current position in the range. | |
| class_type | operator++ (int) |
| Advances the current position in the range, returning a copy of the range prior to its being advanced. | |
Public Types | |
Member Types | |
| typedef I | iterator_type |
| The iterator type. | |
| typedef T | traits_type |
| The traits type. | |
| typedef iterable_range_tag | range_tag_type |
| The range tag type. | |
| typedef iterator_range< I, T > | class_type |
| The current instantiation of this type. | |
| typedef traits_type::value_type | value_type |
| The value type. | |
| typedef traits_type::iterator | iterator |
| The mutating (non-const) iterator type. | |
| typedef traits_type::const_iterator | const_iterator |
| The non-mutating (const) iterator type. | |
| typedef traits_type::reference | reference |
| The mutating (non-const) refernce type. | |
| typedef traits_type::const_reference | const_reference |
| The non-mutating (const) reference type. | |
Public Member Functions | |
Construction | |
| template<typename I2> | |
| iterator_range (I2 first, I2 last) | |
| Constructs from an iterator pair. | |
| template<typename T2, size_t N> | |
| iterator_range (T2(&ar)[N]) | |
| Constructs from an array. | |
Iterable Range methods | |
| iterator | begin () |
| Returns an iterator to the current position of the range. | |
| iterator | end () |
| Returns an iterator to the end of the range. | |
| const_iterator | begin () const |
| Returns an iterator to the current position of the range. | |
| const_iterator | end () const |
| Returns an iterator to the end of the range. | |
| typedef I iterator_type |
The iterator type.
| typedef T traits_type |
The traits type.
| typedef iterable_range_tag range_tag_type |
The range tag type.
| typedef iterator_range<I, T> class_type |
The current instantiation of this type.
| typedef traits_type::value_type value_type |
The value type.
| typedef traits_type::iterator iterator |
The mutating (non-const) iterator type.
| typedef traits_type::const_iterator const_iterator |
The non-mutating (const) iterator type.
| typedef traits_type::reference reference |
The mutating (non-const) refernce type.
| typedef traits_type::const_reference const_reference |
The non-mutating (const) reference type.
| iterator_range | ( | I2 | first, | |
| I2 | last | |||
| ) | [inline] |
Constructs from an iterator pair.
| iterator_range | ( | T2(&) | ar[N] | ) | [inline] |
Constructs from an array.
| bool is_open | ( | ) | const [inline] |
Indicates whether the range is open.
| reference current | ( | ) | [inline] |
| const_reference current | ( | ) | const [inline] |
| operator boolean_type | ( | ) | const [inline] |
Indicates whether the range is open.
| reference operator* | ( | ) | [inline] |
Returns the current value in the range.
| const_reference operator* | ( | ) | const [inline] |
Returns the current value in the range.
| class_type& advance | ( | ) | [inline] |
| class_type& operator++ | ( | ) | [inline] |
Advances the current position in the range.
| class_type operator++ | ( | int | ) | [inline] |
Advances the current position in the range, returning a copy of the range prior to its being advanced.
| iterator begin | ( | ) | [inline] |
Returns an iterator to the current position of the range.
| iterator end | ( | ) | [inline] |
Returns an iterator to the end of the range.
| const_iterator begin | ( | ) | const [inline] |
Returns an iterator to the current position of the range.
| const_iterator end | ( | ) | const [inline] |
Returns an iterator to the end of the range.
1.5.6