std::distance
<iterator>
template<class InputIterator> typename iterator_traits<InputIterator>::difference_type distance (InputIterator first, InputIterator last);
Return distance between iterators
Calculates the number of elements between
first
and
last
.
If i is a Random Access Iterator , the function uses operator- to calculate this. Otherwise, the function uses the increase operator ( operator++ ) repeatedly.