24 Ranges library [ranges]

24.3 Range access [range.access]

24.3.1 ranges​::​begin [range.access.begin]

The name ranges​::​begin denotes a customization point object.
The expression ranges​::​​begin(E) for some subexpression E is expression-equivalent to:
  • E + 0 if E is an lvalue of array type ([basic.compound]).
  • Otherwise, if E is an lvalue, decay-copy(E.begin()) if it is a valid expression and its type I models input_­or_­output_­iterator.
  • Otherwise, decay-copy(begin(E)) if it is a valid expression and its type I models input_­or_­output_­iterator with overload resolution performed in a context that includes the declarations:
    template<class T> void begin(T&&) = delete;
    template<class T> void begin(initializer_list<T>&&) = delete;
    and does not include a declaration of ranges​::​begin.
  • Otherwise, ranges​::​begin(E) is ill-formed.
    : This case can result in substitution failure when ranges​::​begin(E) appears in the immediate context of a template instantiation. — end note
Whenever ranges​::​begin(E) is a valid expression, its type models input_­or_­output_­iterator.
— end note