#include <rangelib/associative_range.hpp>

| S | The associative class | |
| T | The associative 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(associative_range<std::vector<int> > r(numbers); 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 key+value pair in the range. | |
| const_reference | current () const |
| Returns the current key+value pair in the range. | |
| key_type | current_key () |
| Returns the key of the current item in the range. | |
| key_type | current_key () const |
| Returns the value of the current item in the range. | |
| mapped_type | current_value () |
| Returns the value of the current item in the range. | |
| mapped_type | current_value () const |
| Returns the value of the current item in the range. | |
| class_type & | advance () |
| Advances the current position in the range. | |
| operator boolean_type () const | |
| Indicates whether the range is open. | |
| reference | operator* () |
| Returns the current key+value pair in the range. | |
| const_reference | operator* () const |
| Returns the current key+value pair 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 | |
| typedef S | associative_type |
| The associative type. | |
| typedef T | traits_type |
| The traits type. | |
| typedef iterable_range_tag | range_tag_type |
| The range category tag type. | |
| typedef associative_range< S, T > | class_type |
| The current instantiation of the type. | |
| typedef traits_type::associative_reference_type | associative_reference_type |
| The associative reference type. | |
| typedef traits_type::key_type | key_type |
| The key type. | |
| typedef traits_type::mapped_type | mapped_type |
| The referent 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 S2> | |
| associative_range (S2 &seq) | |
| Constructor. | |
| associative_range (class_type const &rhs) | |
| Copy constructor. | |
| class_type & | operator= (class_type const &rhs) |
| Copy assignment operator. | |
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 associative_type |
The associative type.
| typedef T traits_type |
The traits type.
| typedef iterable_range_tag range_tag_type |
The range category tag type.
| typedef associative_range<S, T> class_type |
The current instantiation of the type.
| typedef traits_type::associative_reference_type associative_reference_type |
The associative reference type.
| typedef traits_type::key_type key_type |
The key type.
| typedef traits_type::mapped_type mapped_type |
The referent 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.
| associative_range | ( | S2 & | seq | ) | [inline] |
Constructor.
| seq | The associative which will be adapted to a range |
| associative_range | ( | class_type const & | rhs | ) | [inline] |
Copy constructor.
| class_type& operator= | ( | class_type const & | rhs | ) | [inline] |
Copy assignment operator.
References associative_range::m_last, and associative_range::m_position.
| bool is_open | ( | ) | const [inline] |
Indicates whether the range is open.
| reference current | ( | ) | [inline] |
| const_reference current | ( | ) | const [inline] |
| key_type current_key | ( | ) | [inline] |
Returns the key of the current item in the range.
| key_type current_key | ( | ) | const [inline] |
Returns the value of the current item in the range.
| mapped_type current_value | ( | ) | [inline] |
Returns the value of the current item in the range.
| mapped_type current_value | ( | ) | const [inline] |
Returns the value of the current item in the range.
| class_type& advance | ( | ) | [inline] |
| operator boolean_type | ( | ) | const [inline] |
Indicates whether the range is open.
| reference operator* | ( | ) | [inline] |
Returns the current key+value pair in the range.
| const_reference operator* | ( | ) | const [inline] |
Returns the current key+value pair in the range.
| 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