[range.access.rbegin] (original) (raw)
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
- If E is an rvalue andenable_borrowed_range<remove_cv_t<T>> is false,ranges::rbegin(E) is ill-formed.
- Otherwise, if T is an array type ([dcl.array]) andremove_all_extents_t<T> is an incomplete type,ranges::rbegin(E) is ill-formed with no diagnostic required.
- Otherwise, if auto(t.rbegin()) is a valid expression whose type modelsinput_or_output_iterator,ranges::rbegin(E) is expression-equivalent toauto(t.rbegin()).
- Otherwise, if T is a class or enumeration type andauto(rbegin(t)) is a valid expression whose type modelsinput_or_output_iterator where the meaning of rbegin is established as-if by performing argument-dependent lookup only ([basic.lookup.argdep]), then ranges::rbegin(E) is expression-equivalent to that expression.
- Otherwise, if both ranges::begin(t) and ranges::end(t) are valid expressions of the same type which modelsbidirectional_iterator ([iterator.concept.bidir]),ranges::rbegin(E) is expression-equivalent tomake_reverse_iterator(ranges::end(t)).
- Otherwise, ranges::rbegin(E) is ill-formed.