10 Ranges library [ranges]

10.5 Range primitives [range.primitives]

10.5.3 data [range.primitives.data]

The name data denotes a customization point object ([customization.point.object]). The expression ranges::data(E) for some subexpression E is expression-equivalent to:

  • ranges::data(static_cast<const T&>(E)) if E is an rvalue of type T. This usage is deprecated. [ Note: This deprecated usage exists so that ranges::data(E) behaves similarly to std::data(E) as defined in the C++ Working Paper when E is an rvalue.  — end note ]

  • Otherwise, DECAY_COPY((E).data()) if it is a valid expression of pointer to object type.

  • Otherwise, ranges::begin(E) if it is a valid expression of pointer to object type.

  • Otherwise, ranges::data(E) is ill-formed.

Note: Whenever ranges::data(E) is a valid expression, it has pointer to object type.  — end note ]