[#BloombergLP-bslstl-IteratorUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::IteratorUtil
:relfileprefix: ../../
:mrdocs:

This utility struct provides a namespace for functions on iterators and iterator ranges&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;iteratorutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct IteratorUtil;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/IteratorUtil/IterKey_t.adoc[`IterKey&lowbar;t`] 
| Return the `key&hyphen;type` of the specified iterator type, which is expected to refer to a `pair&lt;KEY&lowbar;TYPE, MAPPED&lowbar;TYPE&gt;`&period;
| xref:BloombergLP/bslstl/IteratorUtil/IterMapped_t.adoc[`IterMapped&lowbar;t`] 
| Return the `mapped&hyphen;type` of the specified iterator type, which is expected to refer to a `pair&lt;KEY&lowbar;TYPE, MAPPED&lowbar;TYPE&gt;`&period;
| xref:BloombergLP/bslstl/IteratorUtil/IterToAlloc_t.adoc[`IterToAlloc&lowbar;t`] 
| Return the type that is actually stored in a map&period; The supplied iterator type is expected to refer to a `pair&lt;KEY&lowbar;TYPE, MAPPED&lowbar;TYPE&gt;`&period;
| xref:BloombergLP/bslstl/IteratorUtil/IterVal_t.adoc[`IterVal&lowbar;t`] 
| Return the `value&lowbar;type` of the specified iterator type&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/IteratorUtil/canCalculateInsertDistance.adoc[`canCalculateInsertDistance`] 
| Return `true` if the calculation of `insertDistance` is supported for iterators of the specified types, `false` otherwise&period;
| xref:BloombergLP/bslstl/IteratorUtil/insertDistance.adoc[`insertDistance`] 
| Return 0 if the (template parameter) type `t&lowbar;INPUT&lowbar;ITERATOR` is limited to the standard input&hyphen;iterator category, otherwise return the number of elements reachable from the specified `first` to (but not including) the specified `last`&period; This function has a constant&hyphen;time complexity if the iterator category of `t&lowbar;INPUT&lowbar;ITERATOR` is strictly a standard input iterator, or is a random access iterator, otherwise it is linear in the length of the range `&lsqb;first &period;&period; last)&rsqb;`&period; The behavior is undefined unless `last` is reachable from `first`&period;
|===



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