24 Ranges library [ranges]

24.3 Range access [range.access]

24.3.2 ranges​::​end [range.access.end]

The name ranges​::​end denotes a customization point object ([customization.point.object]).
Given a subexpression E and an lvalue t that denotes the same object as E, if E is an rvalue and enable_­safe_­range<remove_­cvref_­t<decltype((E))>> is false, ranges​::​end(E) is ill-formed.
Otherwise, ranges​::​end(E) is expression-equivalent to:
  • t + extent_­v<T> if E is of array type ([basic.compound]) T.
  • Otherwise, decay-copy(t.end()) if it is a valid expression and its type S models
    sentinel_for<decltype(ranges::begin(E))>
    
  • Otherwise, decay-copy(end(t)) if it is a valid expression and its type S models
    sentinel_for<decltype(ranges::begin(E))>
    
    with overload resolution performed in a context that includes the declarations:
    template<class T> void end(T&&) = delete;
    template<class T> void end(initializer_list<T>&&) = delete;
    
    and does not include a declaration of ranges​::​end.
  • Otherwise, ranges​::​end(E) is ill-formed.
    Note
    : This case can result in substitution failure when ranges​::​end(E) appears in the immediate context of a template instantiation. — end note
     ]
Note
:
Whenever ranges​::​end(E) is a valid expression, the types S and I of ranges​::​end(E) and ranges​::​begin(E) model sentinel_­for<S, I>.
— end note
 ]