#include <bslstl_iteratorutil.h>
This utility struct provides a namespace for functions on iterators and iterator ranges.
See bslstl_iteratorutil
◆ canCalculateInsertDistance()
template<class t_INPUT_ITERATOR , class t_SENTINEL >
Return true if the calculation of insertDistance is supported for iterators of the specified types, false otherwise.
◆ insertDistance()
template<class t_INPUT_ITERATOR , class t_SENTINEL >
| bsl::iterator_traits< t_INPUT_ITERATOR >::difference_type bslstl::IteratorUtil::insertDistance |
( |
const t_INPUT_ITERATOR & |
first, |
|
|
const t_SENTINEL & |
last |
|
) |
| |
|
static |
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).
- Precondition
- The behavior is undefined unless
last is reachable from first.
The documentation for this struct was generated from the following file: