classPiiBinaryFunctionIterator
#include <PiiIterator.h>
An iterator that uses two iterators in parallel and transforms their values using a binary function.
Description
Given two iterators it1 and it2, and a
function func, this iterator returns func(*it1,
*it2).
// Store the difference of vec1 and vec2 to vec1 QVector<int> vec1(5), vec2(5), vec3(5); Pii::copyN(Pii::binaryFunctionIterator(vec1.begin(), vec2.begin(), std::minus<int>()), vec1.size(), vec1.begin());
Public types
|
typedef std::iterator_traits< Iterator1 >::difference_type
|
|
|
typedef std::iterator_traits< Iterator1 >::iterator_category
|
|
|
typedef value_type *
|
|
|
typedef value_type &
|
|
|
typedef BinaryFunction::result_type
|
Constructors and destructor
|
Constructs a copy of other. |
|
|
(
Constructs an iterator that transforms iterator1 and iterator2 with func. |
Public member functions
|
bool
|
Returns |
|
value_type
|
( )
Returns |
|
( )
Increments both |
|
|
(
Increments both |
|
|
(
Moves both iterators forwards i elements. |
|
|
difference_type
|
Returns the difference between |
|
( )
Decrements both |
|
|
(
Decrements both |
|
|
(
Moves both iterators backwards i elements. |
|
|
bool
|
|
|
bool
|
|
|
Copies other and returns a reference to |
|
|
bool
|
Returns |
|
bool
|
|
|
bool
|
|
|
value_type
|
(
Returns a new PiiBinaryFunctionIterator that is initialized with
|
|
template<class Iterator1, class Iterator2, class
BinaryFunction>
PiiBinaryFunctionIterator<
Iterator1, Iterator2, BinaryFunction >
|
(
Create an iterator that transforms iterator1 and iterator2 with func. |
Function details
-
Constructs a copy of other.
-
PiiBinaryFunctionIterator
(- Iterator1 iterator1
- Iterator2 iterator2
- const BinaryFunction & func
[inline]Constructs an iterator that transforms iterator1 and iterator2 with func.
This constructor is seldom used explicitly; use the Pii::binaryFunctionIterator() function instead.
-
Returns
falseif theiterator1members ofthisand other are equal, andtrueotherwise. -
value_type operator*
()[inline]Returns
func(*iterator1, *iterator2). -
Increments both
iterator1anditerator2.Returns a reference to
this. -
Increments both
iterator1anditerator2.Returns a copy of
this. -
Moves both iterators forwards i elements.
Returns a reference to
this. -
Returns the difference between
iterator1members ofthisand other. -
Decrements both
iterator1anditerator2.Returns a reference to
this. -
Decrements both
iterator1anditerator2.Returns a copy of
this. -
Moves both iterators backwards i elements.
Returns a reference to
this. -
[inline]
-
-
Copies other and returns a reference to
this. -
Returns
trueif theiterator1members ofthisand other are equal, andfalseotherwise. -
-
-
value_type operator[]
(- difference_type index
[inline]Returns a new PiiBinaryFunctionIterator that is initialized with
iterator1[index] anditerator2[index]. -
template<class Iterator1, class Iterator2, class BinaryFunction>
PiiBinaryFunctionIterator< Iterator1, Iterator2, BinaryFunction > binaryFunctionIterator
(- Iterator1 iterator1
- Iterator2 iterator2
- const BinaryFunction & func
Create an iterator that transforms iterator1 and iterator2 with func.
Add a note
Not a single note added yet. Be the first, add yours.