#include <rangelib/sequence_range.hpp>
S | The sequence class | |
T | The sequence range traits, used to deduce the Range's iterator, const_iterator, reference, const_reference and value_type |
It could be used as follows
void dump_elements(std::vector<int> const& numbers) { for(sequence_range<std::vector<int> > r(numbers); r; ++r) { std::cout << &r; // Dump the current value to stdout } }
Public Types | |
typedef S | sequence_type |
The sequence type. | |
typedef T | traits_type |
The traits type. | |
typedef iterable_range_tag | range_tag_type |
The range category tag type. | |
typedef sequence_range< S, T > | class_type |
The current instantiation of the type. | |
typedef traits_type::sequence_reference_type | sequence_reference_type |
The sequence reference 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) reference type. | |
typedef traits_type::const_reference | const_reference |
The non-mutating (const) reference type. | |
typedef traits_type::difference_type | difference_type |
The difference type. | |
typedef traits_type::size_type | size_type |
The size type. | |
Public Member Functions | |
template<typename S1> | |
sequence_range (S1 &rhs) | |
Constructor. | |
template<size_t N> | |
sequence_range (S(&ar)[N]) | |
Constructs a range over an array. | |
sequence_range (iterator position, iterator last) | |
Constructs from an iterator. | |
sequence_range (class_type const &rhs) | |
Copy constructor. | |
class_type & | operator= (class_type const &rhs) |
Copy assignment operator. | |
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. | |
class_type & | advance () |
Advances the current position in the range. | |
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 S sequence_type |
The sequence type.
typedef T traits_type |
typedef iterable_range_tag range_tag_type |
The range category tag type.
typedef sequence_range<S, T> class_type |
typedef traits_type::sequence_reference_type sequence_reference_type |
The sequence reference 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 |
typedef traits_type::const_reference const_reference |
typedef traits_type::difference_type difference_type |
The difference type.
typedef traits_type::size_type size_type |
The size type.
sequence_range | ( | S1 & | rhs | ) | [inline] |
Constructor.
rhs | The sequence which will be adapted to a range |
sequence_range | ( | S(&) | ar[N] | ) | [inline] |
Constructs a range over an array.
sequence_range | ( | iterator | position, | |
iterator | last | |||
) | [inline] |
Constructs from an iterator.
position | The start position of the range | |
last | The end position of the range |
sequence_range | ( | class_type const & | rhs | ) | [inline] |
Copy constructor.
class_type& operator= | ( | class_type const & | rhs | ) | [inline] |
Copy assignment operator.
bool is_open | ( | ) | const [inline] |
Indicates whether the range is open.
reference current | ( | ) | [inline] |
const_reference current | ( | ) | const [inline] |
class_type& advance | ( | ) | [inline] |
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.