classPiiUnaryFunctionIterator
#include <PiiIterator.h>
An iterator that transforms another iterator using a unary function.
Description
Given a function func and an iterator it,
this iterator returns func(*it).
// Add two to all elements of vec1 and store the result to vec2 QVector<int> vec1(5), vec2(5); Pii::copyN(Pii::unaryFunctionIterator(vec1.begin(), std::bind2nd(std::plus<int>(), 2)), vec1.size(), vec2.begin());
Public types
|
typedef std::iterator_traits< Iterator >::difference_type
|
|
|
typedef std::iterator_traits< Iterator >::iterator_category
|
|
|
typedef value_type *
|
|
|
typedef value_type &
|
|
|
typedef UnaryFunction::result_type
|
Constructors and destructor
|
Constructs a copy of other. |
|
|
(
Constructs an iterator that transforms iterator with func. |
Public member functions
|
bool
|
Returns |
|
value_type
|
( )
Returns |
|
( )
Increments |
|
|
(
Increments |
|
|
(
Moves |
|
|
difference_type
|
Returns the difference between |
|
( )
Decrements |
|
|
(
Decrements |
|
|
(
Moves |
|
|
bool
|
|
|
bool
|
|
|
Copies other and returns a reference to |
|
|
bool
|
Returns |
|
bool
|
|
|
bool
|
|
|
value_type
|
(
Returns a new PiiUnaryFunctionIterator that is initialized with
|
|
template<class Iterator, class UnaryFunction>
PiiUnaryFunctionIterator<
Iterator, UnaryFunction >
|
(
Create an iterator that transforms iterator with func. |
Function details
-
Constructs a copy of other.
-
PiiUnaryFunctionIterator
(- Iterator iterator
- const UnaryFunction & func
[inline]Constructs an iterator that transforms iterator with func.
This constructor is seldom used explicitly; use the Pii::unaryFunctionIterator() function instead.
-
Returns
falseif theiteratormembers ofthisand other are equal, andtrueotherwise. -
value_type operator*
()[inline]Returns
func(*iterator). -
Increments
iteratorand returns a reference tothis. -
Increments
iteratorand returns a copy ofthis. -
Moves
iteratorforwards i elements.Returns a reference to
this. -
Returns the difference between
iteratormembers ofthisand other. -
Decrements
iteratorand returns a reference tothis. -
Decrements
iteratorand returns a copy ofthis. -
Moves
iteratorbackwards i elements.Returns a reference to
this. -
[inline]
-
-
Copies other and returns a reference to
this. -
Returns
trueif theiteratormembers ofthisand other are equal, andfalseotherwise. -
-
-
value_type operator[]
(- difference_type index
[inline]Returns a new PiiUnaryFunctionIterator that is initialized with
iterator[index]. -
template<class Iterator, class UnaryFunction>
PiiUnaryFunctionIterator< Iterator, UnaryFunction > unaryFunctionIterator
(- Iterator iterator
- const UnaryFunction & func
Create an iterator that transforms iterator with func.
Add a note
Not a single note added yet. Be the first, add yours.