[range.prim.data]

# 25 Ranges library [[ranges]](./#ranges)

## 25.3 Range access [[range.access]](range.access#range.prim.data)

### 25.3.14 ranges​::​data [range.prim.data]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L1203)

The name ranges​::​data denotes a customization point
object ([[customization.point.object]](customization.point.object "16.3.3.3.5 Customization Point Object types"))[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L1207)

Given a subexpression E with type T,
let t be an lvalue that denotes the reified object for E[.](#2.sentence-1)

Then:

- [(2.1)](#2.1)

  If E is an rvalue and enable_borrowed_range<remove_cv_t<T>> is false, ranges​::​data(E) is ill-formed[.](#2.1.sentence-1)

- [(2.2)](#2.2)

  Otherwise, if T is an array type ([[dcl.array]](dcl.array#term.array.type "9.3.4.5 Arrays")) and remove_all_extents_t<T> is an incomplete type, ranges​::​data(E) is ill-formed with no diagnostic required[.](#2.2.sentence-1)

- [(2.3)](#2.3)

  Otherwise, if auto(t.data()) is a valid expression of pointer to object type, ranges​::​data(E) is expression-equivalent to auto(t.data())[.](#2.3.sentence-1)

- [(2.4)](#2.4)

  Otherwise, if ranges​::​begin(t) is a valid expression whose type models [contiguous_iterator](iterator.concept.contiguous#concept:contiguous_iterator "24.3.4.14 Concept contiguous_­iterator [iterator.concept.contiguous]"), ranges​::​data(E) is expression-equivalent to to_address(ranges​::​begin(t))[.](#2.4.sentence-1)

- [(2.5)](#2.5)

  Otherwise, ranges​::​data(E) is ill-formed[.](#2.5.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L1239)

[*Note [1](#note-1)*:

Diagnosable ill-formed cases above
result in substitution failure when ranges​::​data(E) appears in the immediate context of a template instantiation[.](#3.sentence-1)

â *end note*]

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L1246)

[*Note [2](#note-2)*:

Whenever ranges​::​data(E) is a valid expression, it
has pointer to object type[.](#4.sentence-1)

â *end note*]
