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

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;

== 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;]
----

== 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;]`
| The `TransformIterator&lowbar;AllocatorOfIteratorMethod` class template has an allocator method when its boolean template parameter is `true`, which will be made to be the case when the iterator of the transform iterator uses allocators&period; The transform iterator type itself is supplied as `BASE&lowbar;TYPE`&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;]`
| The `TransformIterator&lowbar;AllocatorOfFunctorMethod` class template has an allocator method when its boolean template parameter is `true`, which will be made to be the case when the iterator of the transform iterator does not use allocators and the functor of the transform iterator uses allocators&period; The transform iterator type itself is supplied as `BASE&lowbar;TYPE`&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 the functor of this object to the result of dereferencing the underlying iterator&period; The behavior is undefined if dereferencing the underlying iterator is undefined&period; Note that the behavior of this method is equivalent to&colon; &grave; functor()(&ast;iterator()) &grave;
| xref:BloombergLP/bdlb/TransformIterator/operator_inc.adoc[`operator&plus;&plus;`] 
| Increment the underlying iterator of this object, and return a reference providing modifiable access to this object&period; The behavior is undefined if incrementing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Advance the underlying iterator of this object by the specified (signed) `offset`, and return a reference providing modifiable access to this object&period; The behavior is undefined if so advancing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Decrement the underlying iterator of this object, and return a reference providing modifiable access to this object&period; The behavior is undefined if decrementing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Regress the underlying iterator of this object by the specified (signed) `offset`, and return a reference providing modifiable access to this object&period; The behavior is undefined if so regressing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_ptr-09.adoc[`operator&hyphen;&gt;`] 
| Return the address of the result of applying the functor of this object to the result of dereferencing the underlying iterator&period; The behavior is undefined if dereferencing the underlying iterator is undefined&period; Note that the behavior of this method is equivalent to&colon; &grave; &amp;functor()(&ast;iterator()) &grave; Also note that the functor must return a reference type for this method to be used&period;
| xref:BloombergLP/bdlb/TransformIterator/operator_subs-04.adoc[`operator&lsqb;&rsqb;`] 
| Return the result of applying the functor of this object to the result of dereferencing the underlying iterator advanced by the specified (signed) `offset`&period; The behavior is undefined if so advancing or dereferencing the underlying iterator is undefined&period; Note that the behavior of this method is equivalent to&colon; &grave; functor()(iterator()&lsqb;offset&rsqb;) &grave;
| xref:BloombergLP/bdlb/TransformIterator/swap.adoc[`swap`] 
| Efficiently exchange the value of this object with the value of the specified `other` object by applying `swap` to each of the functor and underlying iterator fields of the two objects&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 iterator of the specified `lhs` compares unequal to the underlying iterator of the specified `rhs`, and `false` otherwise&period; The behavior is undefined if comparing the underlying iterators in this way is undefined&period; Note that the functors are not compared&period;
| xref:BloombergLP/bdlb/operator_plus-03.adoc[`operator&plus;`]
| Return a copy of the specified `iterator` object with its underlying iterator advanced by the specified (signed) `offset` from that of `iterator`&period; The behavior is undefined if so advancing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/operator_plus-0f.adoc[`operator&plus;`]
| Return a copy of the specified `iterator` object with its underlying iterator advanced by the specified (signed) `offset` from that of `iterator`&period; The behavior is undefined if so advancing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/operator_inc-0e.adoc[`operator&plus;&plus;`]
| Increment the underlying iterator of the specified `iterator`, and return a copy of `iterator` _before_ the increment&period; The behavior is undefined if incrementing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/operator_minus-04.adoc[`operator&hyphen;`]
| Return the result of subtracting the underlying iterator of the specified `a` object from the underlying iterator of the specified `b` object&period; The behavior is undefined if this subtraction is undefined&period;
| xref:BloombergLP/bdlb/operator_minus-09.adoc[`operator&hyphen;`]
| Return a copy of the specified `iterator` object with its underlying iterator regressed by the specified (signed) `offset` from that of `iterator`&period; The behavior is undefined if so regressing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/operator_dec.adoc[`operator&hyphen;&hyphen;`]
| Decrement the underlying iterator of the specified `iterator`, and return a copy of `iterator` _before_ the decrement&period; The behavior is undefined if decrementing the underlying iterator is undefined&period;
| xref:BloombergLP/bdlb/operator_lt-042.adoc[`operator&lt;`]
| Return `true` if the underlying iterator of the specified `lhs` compares less than the underlying iterator of the specified `rhs`, and `false` otherwise&period; The behavior is undefined if comparing the underlying iterators in this way is undefined&period; Note that the functors are not compared&period;
| xref:BloombergLP/bdlb/operator_le-0f9.adoc[`operator&lt;&equals;`]
| Return `true` if the underlying iterator of the specified `lhs` compares less than or equal to the underlying iterator of the specified `rhs`, and `false` otherwise&period; The behavior is undefined if comparing the underlying iterators in this way is undefined&period; Note that the functors are not compared&period;
| xref:BloombergLP/bdlb/operator_eq-0f63.adoc[`operator&equals;&equals;`]
| Return `true` if the underlying iterator of the specified `lhs` compares equal to the underlying iterator of the specified `rhs`, and `false` otherwise&period; The behavior is undefined if comparing the underlying iterators in this way is undefined&period; Note that the functors are not compared&period;
| xref:BloombergLP/bdlb/operator_gt-011b.adoc[`operator&gt;`]
| Return `true` if the underlying iterator of the specified `lhs` compares greater than the underlying iterator of the specified `rhs`, and `false` otherwise&period; The behavior is undefined if comparing the underlying iterators in this way is undefined&period; Note that the functors are not compared&period;
| xref:BloombergLP/bdlb/operator_ge-0cf5.adoc[`operator&gt;&equals;`]
| Return `true` if the underlying iterator of the specified `lhs` compares greater than or equal to the underlying iterator of the specified `rhs`, and `false` otherwise&period; The behavior is undefined if comparing the underlying iterators in this way is undefined&period; Note that the functors are not compared&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]#
