[#BloombergLP-bdlb-TransformIterator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::TransformIterator :relfileprefix: ../../ :mrdocs: Wrapping iterator that invokes a functor on dereference. == Synopsis Declared in `<bdlb_transformiterator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class FUNCTOR, class ITERATOR> class TransformIterator : public xref:BloombergLP/bdlb/TransformIterator_AllocatorOfIteratorMethod-00.adoc[TransformIterator_AllocatorOfIteratorMethod<TransformIterator<FUNCTOR, ITERATOR>, bslma::UsesBslmaAllocator<ITERATOR>::value>] , public xref:BloombergLP/bdlb/TransformIterator_AllocatorOfFunctorMethod-01.adoc[TransformIterator_AllocatorOfFunctorMethod<TransformIterator<FUNCTOR, ITERATOR>, !bslma::UsesBslmaAllocator<ITERATOR>::value && bslma::UsesBslmaAllocator<FUNCTOR>::value>] ---- == 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. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdlb/TransformIterator_AllocatorOfIteratorMethod-00.adoc[TransformIterator_AllocatorOfIteratorMethod<TransformIterator<FUNCTOR, ITERATOR>, bslma::UsesBslmaAllocator<ITERATOR>::value>]` | Base class template that optionally provides an `allocator` method. | `xref:BloombergLP/bdlb/TransformIterator_AllocatorOfFunctorMethod-01.adoc[TransformIterator_AllocatorOfFunctorMethod<TransformIterator<FUNCTOR, ITERATOR>, !bslma::UsesBslmaAllocator<ITERATOR>::value && bslma::UsesBslmaAllocator<FUNCTOR>::value>]` | Base class template that optionally provides an `allocator` method. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlb/TransformIterator/difference_type.adoc[`difference_type`] | Type used to represent distances between iterators. | xref:BloombergLP/bdlb/TransformIterator/iterator_category.adoc[`iterator_category`] | Iterator category of this transform iterator. | xref:BloombergLP/bdlb/TransformIterator/pointer.adoc[`pointer`] | Pointer type for this iterator. | xref:BloombergLP/bdlb/TransformIterator/reference.adoc[`reference`] | Reference type returned by dereferencing this iterator. | xref:BloombergLP/bdlb/TransformIterator/value_type.adoc[`value_type`] | Value type produced by dereferencing this iterator. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlb/TransformIterator/2constructor-026.adoc[`TransformIterator`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlb/TransformIterator/operator_assign.adoc[`operator=`] | Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object. | xref:BloombergLP/bdlb/TransformIterator/functor-0c.adoc[`functor`] | `functor` overloads | xref:BloombergLP/bdlb/TransformIterator/iterator-00.adoc[`iterator`] | `iterator` overloads | xref:BloombergLP/bdlb/TransformIterator/operator_star-04.adoc[`operator*`] | Return the result of applying this object's functor to `*iterator()`. | xref:BloombergLP/bdlb/TransformIterator/operator_inc.adoc[`operator++`] | Increment this iterator and return a reference to it. | xref:BloombergLP/bdlb/TransformIterator/operator_plus_eq.adoc[`operator+=`] | Advance this iterator by the specified `offset`. | xref:BloombergLP/bdlb/TransformIterator/operator_dec.adoc[`operator‐‐`] | Decrement this iterator and return a reference to it. | xref:BloombergLP/bdlb/TransformIterator/operator_minus_eq.adoc[`operator‐=`] | Regress this iterator by the specified `offset`. | xref:BloombergLP/bdlb/TransformIterator/operator_ptr-09.adoc[`operator‐>`] | Return the address of the transformed current element. | xref:BloombergLP/bdlb/TransformIterator/operator_subs-04.adoc[`operator[]`] | Return the transformed element at the specified offset. | xref:BloombergLP/bdlb/TransformIterator/swap.adoc[`swap`] | Exchange the value of this object with that of `other`. | xref:BloombergLP/bdlb/TransformIterator/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<TransformIterator, UsesBslmaAllocator, bslma::UsesBslmaAllocator<ITERATOR>::value || bslma::UsesBslmaAllocator<FUNCTOR>::value>`] | Nested trait declaration for `bslma::UsesBslmaAllocator`. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlb/operator_not_eq-01f.adoc[`operator!=`] | Return `true` if the underlying iterators of `lhs` and `rhs` are unequal. | xref:BloombergLP/bdlb/operator_plus-03.adoc[`operator+`] | Return a copy of `iterator` advanced by the specified `offset`. | xref:BloombergLP/bdlb/operator_plus-0f.adoc[`operator+`] | Return a copy of `iterator` advanced by the specified `offset`. | xref:BloombergLP/bdlb/operator_inc-0e.adoc[`operator++`] | Increment `iterator` and return a copy of its previous value. | xref:BloombergLP/bdlb/operator_minus-04.adoc[`operator‐`] | Return the distance from the underlying iterator of `b` to that of `a`. | xref:BloombergLP/bdlb/operator_minus-09.adoc[`operator‐`] | Return a copy of `iterator` regressed by the specified `offset`. | xref:BloombergLP/bdlb/operator_dec.adoc[`operator‐‐`] | Decrement `iterator` and return a copy of its previous value. | xref:BloombergLP/bdlb/operator_lt-042.adoc[`operator<`] | Return `true` if the underlying iterator of `lhs` is less than `rhs`. | xref:BloombergLP/bdlb/operator_le-0f9.adoc[`operator<=`] | Return `true` if the underlying iterator of `lhs` is at most that of `rhs`. | xref:BloombergLP/bdlb/operator_eq-0f63.adoc[`operator==`] | Return `true` if the underlying iterators of `lhs` and `rhs` are equal. | xref:BloombergLP/bdlb/operator_gt-011b.adoc[`operator>`] | Return `true` if the underlying iterator of `lhs` is greater than `rhs`. | xref:BloombergLP/bdlb/operator_ge-0cf5.adoc[`operator>=`] | Return `true` if the underlying iterator of `lhs` is at least that of `rhs`. | xref:BloombergLP/bdlb/swap-0d.adoc[`swap`] | Efficiently 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#