HGL::Common::combine_iterator< Iterator, CombineFunction > Class Template Reference
[Utility classes]

A pairwise stepping and result combining input iterator adaptor. More...

#include <combine_iterator.h>

List of all members.

Public Member Functions

 combine_iterator (const iterator_type &first, const iterator_type &last, const CombineFunction &c, const base_value_type &d=base_value_type())

Detailed Description

template<class Iterator, typename CombineFunction>
class HGL::Common::combine_iterator< Iterator, CombineFunction >

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*()

See also:
combiner on how to create this iterator conveniently
Warning:
on odd sized collections the behaviour is undefined if no last iterator is given, else the provided value d is used if the container reaches last.
Note:
If d is not given it is constructed using it's default constructor.

d is the underlying iterator value_type

Template Parameters:
Iterator an input iterator
CombineFunction the combining binary function c
Author:
Heiko Schäfer <heiko@hgl.rangun.de>
Since:
0.5.26

Constructor & Destructor Documentation

template<class Iterator , typename CombineFunction >
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

Parameters:
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
Since:
0.5.26

Generated on 9 Apr 2014 for hgl 0.5.26~svn by  doxygen 1.6.1