[#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. == Synopsis Declared in `<bslstl_iteratorutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct IteratorUtil; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/IteratorUtil/IterKey_t.adoc[`IterKey_t`] | Return the `key‐type` of the specified iterator type, which is expected to refer to a `pair<KEY_TYPE, MAPPED_TYPE>`. | xref:BloombergLP/bslstl/IteratorUtil/IterMapped_t.adoc[`IterMapped_t`] | Return the `mapped‐type` of the specified iterator type, which is expected to refer to a `pair<KEY_TYPE, MAPPED_TYPE>`. | xref:BloombergLP/bslstl/IteratorUtil/IterToAlloc_t.adoc[`IterToAlloc_t`] | Return the type that is actually stored in a map. The supplied iterator type is expected to refer to a `pair<KEY_TYPE, MAPPED_TYPE>`. | xref:BloombergLP/bslstl/IteratorUtil/IterVal_t.adoc[`IterVal_t`] | Return the `value_type` of the specified iterator type. |=== == 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. | xref:BloombergLP/bslstl/IteratorUtil/insertDistance.adoc[`insertDistance`] | Return 0 if the (template parameter) type `t_INPUT_ITERATOR` is limited to the standard input‐iterator category, otherwise return the number of elements reachable from the specified `first` to (but not including) the specified `last`. This function has a constant‐time complexity if the iterator category of `t_INPUT_ITERATOR` is strictly a standard input iterator, or is a random access iterator, otherwise it is linear in the length of the range `[first .. last)]`. The behavior is undefined unless `last` is reachable from `first`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#