23 Ranges library [ranges]

23.3 Range access [range.access]

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

The name ranges::end denotes a customization point object.
The expression ranges::end(E) for some subexpression E is expression-equivalent to:
  • E + extent_­v<T> if E is an lvalue of array type ([basic.compound]) T.
  • Otherwise, if E is an lvalue, decay-copy(E.end()) if it is a valid expression and its type S models Sentinel<decltype(​ranges::​begin(E))>.
  • Otherwise, decay-copy(end(E)) if it is a valid expression and its type S models Sentinel<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<S, I>.
end note
]