24 Ranges library [ranges]

24.3 Range access [range.access]

24.3.6 ranges​::​rend [range.access.rend]

The name ranges​::​rend denotes a customization point object.
The expression ranges​::​rend(E) for some subexpression E is expression-equivalent to:
  • If E is an lvalue, decay-copy(E.rend()) if it is a valid expression and its type S models
    sentinel_for<decltype(ranges::rbegin(E))>
      
  • Otherwise, decay-copy(rend(E)) if it is a valid expression and its type S models
    sentinel_for<decltype(ranges::rbegin(E))>
      
    with overload resolution performed in a context that includes the declaration:
    template<class T> void rend(T&&) = delete;
      
    and does not include a declaration of ranges​::​rend.
  • 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 models bidirectional_­iterator ([iterator.concept.bidir]).
  • Otherwise, ranges​::​rend(E) is ill-formed.
    Note
    : This case can result in substitution failure when ranges​::​rend(E) appears in the immediate context of a template instantiation. — end note
     ]
Note
:
Whenever ranges​::​rend(E) is a valid expression, the types S and I of ranges​::​rend(E) and ranges​::​rbegin(E) model sentinel_­for<S, I>.
— end note
 ]