yat
0.20.3pre
|
Iterate over several ranges as if ranges have been merged. More...
#include <yat/utility/MergeIterator.h>
Public Member Functions | |
MergeIterator (void) | |
MergeIterator (const std::vector< std::pair< Base, Base > > &vec) | |
Create MergeIterator. More... | |
MergeIterator (const std::vector< std::pair< Base, Base > > &vec, const Compare &comp) | |
Creates MergeIterator using comp as compare object. More... | |
Friends | |
class | boost::iterator_core_access |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Base > | |
MergeIterator< Base > | make_merge_iterator (const std::vector< std::pair< Base, Base > > &vec) |
template<typename Base , class Compare > | |
MergeIterator< Base, Compare > | make_merge_iterator (const std::vector< std::pair< Base, Base > > &vec, const Compare &comp) |
Iterate over several ranges as if ranges have been merged.
MergeIterator is an Input Iterator that is created from several ranges and will iterate over the elements in the ranges as if ranges have been merged. Input ranges have to be sorted (as defined by the Compare
object) or behaviour is undefined. When incremented, the iterator looks at next element in each range, identifies the smallest element, and points at that.
Type Requirements:
Base
is a Readable IteratorBase
is a Single Pass IteratorCompare
models StrictWeakOrdering
|
inline |
Creates an end-of-range iterator
|
inline |
Create MergeIterator.
Create a MergeIterator that will iterate over ranges [vec[0].first, vec[0].second), [vec[1].first, vec[1].second), ...
|
inline |
Creates MergeIterator using comp as compare object.
Same as MergeIterator(2) but using comp rather than using a default constructed Compare object.
|
related |
Creates a MergeIterator that iterates over ranges defined in vec.
|
related |
Creates a MergeIterator that iterates over ranges defined in vec, using comp to compare elements.