[#BloombergLP-bdlb-TransformIterator]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::TransformIterator
:relfileprefix: ../../
:mrdocs:

Wrapping iterator that invokes a functor on dereference&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;transformiterator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class FUNCTOR,
    class ITERATOR&gt;
class TransformIterator
    : public xref:BloombergLP/bdlb/TransformIterator_AllocatorOfIteratorMethod-00.adoc[TransformIterator&lowbar;AllocatorOfIteratorMethod&lt;TransformIterator&lt;FUNCTOR, ITERATOR&gt;, bslma&colon;&colon;UsesBslmaAllocator&lt;ITERATOR&gt;&colon;&colon;value&gt;]
    , public xref:BloombergLP/bdlb/TransformIterator_AllocatorOfFunctorMethod-01.adoc[TransformIterator&lowbar;AllocatorOfFunctorMethod&lt;TransformIterator&lt;FUNCTOR, ITERATOR&gt;, !bslma&colon;&colon;UsesBslmaAllocator&lt;ITERATOR&gt;&colon;&colon;value &amp;&amp; bslma&colon;&colon;UsesBslmaAllocator&lt;FUNCTOR&gt;&colon;&colon;value&gt;]
----

== Description

The transform iterator class itself&period; Its job is to hold a functor and an iterator, pass through all iterator&hyphen;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&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlb/TransformIterator_AllocatorOfIteratorMethod-00.adoc[TransformIterator&lowbar;AllocatorOfIteratorMethod&lt;TransformIterator&lt;FUNCTOR, ITERATOR&gt;, bslma&colon;&colon;UsesBslmaAllocator&lt;ITERATOR&gt;&colon;&colon;value&gt;]`
| Base class template that optionally provides an `allocator` method&period;
| `xref:BloombergLP/bdlb/TransformIterator_AllocatorOfFunctorMethod-01.adoc[TransformIterator&lowbar;AllocatorOfFunctorMethod&lt;TransformIterator&lt;FUNCTOR, ITERATOR&gt;, !bslma&colon;&colon;UsesBslmaAllocator&lt;ITERATOR&gt;&colon;&colon;value &amp;&amp; bslma&colon;&colon;UsesBslmaAllocator&lt;FUNCTOR&gt;&colon;&colon;value&gt;]`
| Base class template that optionally provides an `allocator` method&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/TransformIterator/difference_type.adoc[`difference&lowbar;type`] 
| Type used to represent distances between iterators&period;
| xref:BloombergLP/bdlb/TransformIterator/iterator_category.adoc[`iterator&lowbar;category`] 
| Iterator category of this transform iterator&period;
| xref:BloombergLP/bdlb/TransformIterator/pointer.adoc[`pointer`] 
| Pointer type for this iterator&period;
| xref:BloombergLP/bdlb/TransformIterator/reference.adoc[`reference`] 
| Reference type returned by dereferencing this iterator&period;
| xref:BloombergLP/bdlb/TransformIterator/value_type.adoc[`value&lowbar;type`] 
| Value type produced by dereferencing this iterator&period;
|===


== 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&equals;`] 
| Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period;
| 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&ast;`] 
| Return the result of applying this object&apos;s functor to `&ast;iterator()`&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_inc.adoc[`operator&plus;&plus;`] 
| Increment this iterator and return a reference to it&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Advance this iterator by the specified `offset`&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Decrement this iterator and return a reference to it&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Regress this iterator by the specified `offset`&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_ptr-09.adoc[`operator&hyphen;&gt;`] 
| Return the address of the transformed current element&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_subs-04.adoc[`operator&lsqb;&rsqb;`] 
| Return the transformed element at the specified offset&period;
| xref:BloombergLP/bdlb/TransformIterator/swap.adoc[`swap`] 
| Exchange the value of this object with that of `other`&period;
| xref:BloombergLP/bdlb/TransformIterator/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;TransformIterator, UsesBslmaAllocator, bslma&colon;&colon;UsesBslmaAllocator&lt;ITERATOR&gt;&colon;&colon;value &verbar;&verbar; bslma&colon;&colon;UsesBslmaAllocator&lt;FUNCTOR&gt;&colon;&colon;value&gt;`] 
| Nested trait declaration for `bslma&colon;&colon;UsesBslmaAllocator`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/operator_not_eq-01f.adoc[`operator!&equals;`]
| Return `true` if the underlying iterators of `lhs` and `rhs` are unequal&period;
| xref:BloombergLP/bdlb/operator_plus-03.adoc[`operator&plus;`]
| Return a copy of `iterator` advanced by the specified `offset`&period;
| xref:BloombergLP/bdlb/operator_plus-0f.adoc[`operator&plus;`]
| Return a copy of `iterator` advanced by the specified `offset`&period;
| xref:BloombergLP/bdlb/operator_inc-0e.adoc[`operator&plus;&plus;`]
| Increment `iterator` and return a copy of its previous value&period;
| xref:BloombergLP/bdlb/operator_minus-04.adoc[`operator&hyphen;`]
| Return the distance from the underlying iterator of `b` to that of `a`&period;
| xref:BloombergLP/bdlb/operator_minus-09.adoc[`operator&hyphen;`]
| Return a copy of `iterator` regressed by the specified `offset`&period;
| xref:BloombergLP/bdlb/operator_dec.adoc[`operator&hyphen;&hyphen;`]
| Decrement `iterator` and return a copy of its previous value&period;
| xref:BloombergLP/bdlb/operator_lt-042.adoc[`operator&lt;`]
| Return `true` if the underlying iterator of `lhs` is less than `rhs`&period;
| xref:BloombergLP/bdlb/operator_le-0f9.adoc[`operator&lt;&equals;`]
| Return `true` if the underlying iterator of `lhs` is at most that of `rhs`&period;
| xref:BloombergLP/bdlb/operator_eq-0f63.adoc[`operator&equals;&equals;`]
| Return `true` if the underlying iterators of `lhs` and `rhs` are equal&period;
| xref:BloombergLP/bdlb/operator_gt-011b.adoc[`operator&gt;`]
| Return `true` if the underlying iterator of `lhs` is greater than `rhs`&period;
| xref:BloombergLP/bdlb/operator_ge-0cf5.adoc[`operator&gt;&equals;`]
| Return `true` if the underlying iterator of `lhs` is at least that of `rhs`&period;
| 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&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
