23 Ranges library [ranges]

23.3 Range access [range.access]

23.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 Iterator.
  • Otherwise, decay-copy(begin(E)) if it is a valid expression and its type I models 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.
    [Note
    :
    This case can result in substitution failure when ranges::begin(E) appears in the immediate context of a template instantiation.
    end note
    ]
[Note
:
Whenever ranges::begin(E) is a valid expression, its type models Iterator.
end note
]