ranges_rend

ranges_rend (범위 역방향 끝 센티널)

std::ranges::rend은 역방향 순회의 끝을 나타내는 센티널을 반환하는 커스터마이제이션 포인트 객체예요. C++20부터 사용할 수 있어요.

출처: cppreference

본문

<ranges> 헤더에 정의되어 있고, <iterator> 헤더에도 정의돼요.

inline namespace /* unspecified */ {
    inline constexpr /* unspecified */ rend = /* unspecified */;
}

(since C++20) (customization point object)

호출 시그니처:

template< class T >
    requires /* see below */
constexpr std::sentinel_for<
    decltype(ranges::rbegin(std::declval<T>()))> auto rend( T&& t );

(since C++20)

역방향 순회의 끝을 나타내는 센티널을 반환해요.

  • T가 배열이면 std::reverse_iterator<T*>(t)를 반환해요.
  • t.rend()가 유효하면 그것을 반환해요.
  • ranges::rbegin(t)가 유효하면 std::make_reverse_iterator(ranges::begin(t))를 반환해요.
  • 그 외에는 rend(t)을 반환해요.

더 알아보기 (Learn more)

cppreference