[range.access.begin] (original) (raw)
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
- If E is an rvalue andenable_borrowed_range<remove_cv_t<T>> is false,ranges::begin(E) is ill-formed.
- Otherwise, if T is an array type ([dcl.array]) andremove_all_extents_t<T> is an incomplete type,ranges::begin(E) is ill-formed with no diagnostic required.
- Otherwise, if T is an array type,ranges::begin(E) is expression-equivalent to t + 0.
- Otherwise, if auto(t.begin()) is a valid expression whose type modelsinput_or_output_iterator,ranges::begin(E) is expression-equivalent toauto(t.begin()).
- Otherwise, if T is a class or enumeration type andauto(begin(t)) is a valid expression whose type modelsinput_or_output_iterator where the meaning of begin is established as-if by performing argument-dependent lookup only ([basic.lookup.argdep]), then ranges::begin(E) is expression-equivalent to that expression.
- Otherwise, ranges::begin(E) is ill-formed.