Quick Links: |
#include <bslstl_iteratorutil.h>
Static Public Member Functions | |
template<class InputIterator > | |
static bsl::iterator_traits < InputIterator > ::difference_type | insertDistance (InputIterator first, InputIterator last) |
This utility struct provides a namespace for functions on iterators and iterator ranges.
See Component bslstl_iteratorutil
bsl::iterator_traits< InputIterator >::difference_type bslstl::IteratorUtil::insertDistance | ( | InputIterator | first, | |
InputIterator | last | |||
) | [static] |
Return 0 if the (template parameter) type InputIterator
is limited to the standard input-iterator category, otherwise return the number of elements that is reachable from the specified first
to (but not including) the specified last
. This function has a constant-time complexity if the iterator category of InputIterator
is a 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
. Note that this function always returns 0 when compiled with the Sun compiler, while we work around issues in the Sun standard library.