BloombergLP::bslstl::operator-

Return the distance from rhs to lhs.

Synopsis

Declared in <bslstl_randomaccessiterator.h>

template<
    class T1,
    class T2,
    class ITER_IMP,
    class TAG_TYPE>
std::ptrdiff_t
operator-(
    RandomAccessIterator<T1, ITER_IMP, TAG_TYPE> const& lhs,
    RandomAccessIterator<T2, ITER_IMP, TAG_TYPE> const& rhs);

Description

Return the distance from the specified rhs iterator to the specified lhs iterator. The behavior is undefined unless lhs and rhs are iterators into the same underlying sequence. Note that the result might be negative.

Return Value

the distance from rhs to lhs

Parameters

NameDescription
lhsending iterator of the distance
rhsstarting iterator of the distance