10 Ranges library [ranges]

10.4 Range access [range.access]

10.4.5 rbegin [range.access.rbegin]

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

  • ranges::rbegin(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::rbegin(E) behaves similarly to std::rbegin(E) as defined in ISO/IEC 14882 when E is an rvalue.  — end note ]

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

  • Otherwise, make_reverse_iterator(ranges::end(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::rbegin(E) is ill-formed.

Note: Whenever ranges::rbegin(E) is a valid expression, its type satisfies Iterator.  — end note ]