10 Ranges library [ranges]

10.4 Range access [range.access]

10.4.6 rend [range.access.rend]

The name rend denotes a customization point object ([customization.point.object]). The expression ranges::rend(E) for some subexpression E is expression-equivalent to:

  • ranges::rend(static_cast<const T&>(E)) if E is an rvalue of type T. This usage is deprecated. [ Note: This deprecated usage exists so that ranges::rend(E) behaves similarly to std::rend(E) as defined in ISO/IEC 14882 when E is an rvalue.  — end note ]

  • Otherwise, DECAY_COPY((E).rend()) if it is a valid expression and its type S meets the syntactic requirements of Sentinel<S, decltype(ranges::rbegin(E))>. If Sentinel is not satisfied, the program is ill-formed with no diagnostic required.

  • Otherwise, make_reverse_iterator(ranges::begin(E)) if both ranges::begin(E) and ranges::end(E) are valid expressions of the same type I which meets the syntactic requirements of BidirectionalIterator<I> ([iterators.bidirectional]).

  • Otherwise, ranges::rend(E) is ill-formed.

Note: Whenever ranges::rend(E) is a valid expression, the types of ranges::rend(E) and ranges::rbegin(E) satisfy Sentinel.  — end note ]