BloombergLP::bslstl::IteratorUtil_LegacyInsertDistance::insertDistance

Return the insertable element count for the specified iterator range.

Synopsis

Declared in <bslstl_iteratorutil.h>

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

Description

Return the number of elements in the range [first, last)] if the (template parameter) type t_SENTINEL is convertible to the (template parameter) type t_INPUT_ITERATOR and t_INPUT_ITERATOR has a forward iterator category; otherwise return 0.

Return Value

the number of elements in [first, last)], or 0 if distance cannot be calculated

Parameters

NameDescription
firstbeginning of the half-open range
lastend of the half-open range