C++
迭代器 | Iterator

operator-(reverse_iterator)

操作员-%28反向[医]迭代器%29

template< class Iterator > typename reverse_iterator::difference_type operator-( const reverse_iterator& lhs, const reverse_iterator& rhs (until C++11)
template< class Iterator1, class Iterator2 > auto operator-( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ) -> decltype(rhs.base() - lhs.base()(since C++11) (until C++17)
template< class Iterator1, class Iterator2 > constexpr auto operator-( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ) -> decltype(rhs.base() - lhs.base()(since C++17)

返回两个迭代器适配器之间的距离。

参数

lhs, rhs-iterator adaptors to compute the difference of

返回值

rhs.base() - lhs.base()...

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/iterator/反向[医]迭代器/运算符-