Library of Assembled Shared Sources
|
iterator adaptor to access members. More...
#include <access_iterator.h>
iterator adaptor to access members.
A prime example is to iterate over the keys or values in a std::map
.
The value_type of the map's iterator is a std::pair
of key and value.
first_accessor_t
is an accessor that will access the first element of the pair, and combined with access_iterator_t
it allows you to directly iterate over just the keys of the map.
A helper function first_iterator
is provided to easily adapt a map's iterator:
Iterator | the iterator type of the original sequence. In the example above, this would be std::map<std::string, int>::iterator |
Accessor | functor type that takes an Iterator as argument and returns a reference to the accessed member. Accessor shall also define value_type , reference and pointer . An example is first_accessor_t |
Definition at line 87 of file access_iterator.h.