A pairwise stepping and result combining input iterator adaptor. More...
#include <combine_iterator.h>
Public Member Functions | |
| combine_iterator (const iterator_type &first, const iterator_type &last, const CombineFunction &c, const base_value_type &d=base_value_type()) | |
A pairwise stepping and result combining input iterator adaptor.
This iterator is pairwise visiting the iterator b, collecting the two values and passing it to the binary function c.
The binary function c should combine the two values and returning it. The return type of c is at the same time the value_type of the operator*()
iterator convenientlylast iterator is given, else the provided value d is used if the container reaches last.d is not given it is constructed using it's default constructor.d is the underlying iterator value_type
| Iterator | an input iterator | |
| CombineFunction | the combining binary function c |
| HGL::Common::combine_iterator< Iterator, CombineFunction >::combine_iterator | ( | const iterator_type & | first, | |
| const iterator_type & | last, | |||
| const CombineFunction & | c, | |||
| const base_value_type & | d = base_value_type() | |||
| ) |
Constructs an input combine_iterator
| first | the underlying iterator to visit | |
| last | the last (exclusive) element to visit | |
| c | the combining binary function | |
| d | the (optional) default value to use if the container contains an odd amount of elements |
1.6.1