24 Ranges library [ranges]

24.3 Range access [range.access]

24.3.5 ranges​::​rbegin [range.access.rbegin]

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