Namespaces
Variants

operator-(ranges::adjacent_view::sentinel)

cppreference.net에서
 
 
Ranges 라이브러리
범위 어댑터
 
 
template< bool OtherConst >
    requires std::sized_sentinel_for<ranges::sentinel_t<Base>,
                                     ranges::iterator_t</*maybe-const*/<OtherConst, V>>>
friend constexpr ranges::range_difference_t</*maybe-const*/<OtherConst, V>>
    operator-( const /*iterator*/<OtherConst>& x, const /*sentinel*/& y );
(1) (C++23부터)
template< bool OtherConst >
    requires std::sized_sentinel_for<ranges::sentinel_t<Base>,
                                     ranges::iterator_t</*maybe-const*/<OtherConst, V>>>
friend constexpr ranges::range_difference_t</*maybe-const*/<OtherConst, V>>
    operator-( const /*sentinel*/& y, const /*iterator*/<OtherConst>& x );
(2) (C++23부터)

x의 기본 반복자와 y의 기본 센티널 사이의 거리를 계산합니다.

current_이 x의 반복자 기본 배열을 나타내고, end_이 y의 기본 센티널을 나타낸다고 가정합니다.

1) 다음과 동일: return x.current_.back() - y.end_;
2) 다음과 동일: return y.end_ - x.current_.back();

이 함수 템플릿은 일반적인 비한정 또는 한정 조회에 보이지 않으며, 인자 종속 조회를 통해서만 찾을 수 있습니다. 단, adjacent_view::sentinel이 인수의 연관 클래스인 경우에 한합니다.

매개변수

x - an iterator
y - a sentinel

반환값

x 와 y 사이의 거리.

예제

참고 항목