BloombergLP::bdlb::TransformIterator

Wrapping iterator that invokes a functor on dereference.

Description

The transform iterator class itself. Its job is to hold a functor and an iterator, pass through all iterator-related operations to the held iterator, and on dereference, call the functor on the result of dereferencing the iterator and return the result of the call instead.

Type Aliases

NameDescription
difference_type Type used to represent distances between iterators.
iterator_category Iterator category of this transform iterator.
pointer Pointer type for this iterator.
reference Reference type returned by dereferencing this iterator.
value_type Value type produced by dereferencing this iterator.

Member Functions

NameDescription
TransformIterator [constructor]Constructors
operator= Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.
functor functor overloads
iterator iterator overloads
operator* Return the result of applying this object's functor to *iterator().
operator++ Increment this iterator and return a reference to it.
operator+= Advance this iterator by the specified offset.
operator-- Decrement this iterator and return a reference to it.
operator-= Regress this iterator by the specified offset.
operator-> Return the address of the transformed current element.
operator[] Return the transformed element at the specified offset.
swap Exchange the value of this object with that of other.
operator BloombergLP::bslmf::NestedTraitDeclaration<TransformIterator, UsesBslmaAllocator, bslma::UsesBslmaAllocator<ITERATOR>::value || bslma::UsesBslmaAllocator<FUNCTOR>::value> Nested trait declaration for bslma::UsesBslmaAllocator.

Non-Member Functions

NameDescription
operator!=Return true if the underlying iterators of lhs and rhs are unequal.
operator+Return a copy of iterator advanced by the specified offset.
operator+Return a copy of iterator advanced by the specified offset.
operator++Increment iterator and return a copy of its previous value.
operator-Return the distance from the underlying iterator of b to that of a.
operator-Return a copy of iterator regressed by the specified offset.
operator--Decrement iterator and return a copy of its previous value.
operator<Return true if the underlying iterator of lhs is less than rhs.
operator<=Return true if the underlying iterator of lhs is at most that of rhs.
operator==Return true if the underlying iterators of lhs and rhs are equal.
operator>Return true if the underlying iterator of lhs is greater than rhs.
operator>=Return true if the underlying iterator of lhs is at least that of rhs.
swapEfficiently exchange the values of the specified a and b objects by applying swap to each of the functor and underlying iterator fields of the two objects.