BloombergLP::bslstl::IteratorUtil::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.

Synopsis

Declared in <bslstl_iteratorutil.h>

template<
    class t_INPUT_ITERATOR,
    class t_SENTINEL>
static
bsl::iterator_traits<t_INPUT_ITERATOR>::difference_type
insertDistance(
    t_INPUT_ITERATOR const& first,
    t_SENTINEL const& last);