tmp/tmp4ji8yf45/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Concept <a id="iterator.concept.contiguous">[[iterator.concept.contiguous]]</a>
|
| 2 |
+
|
| 3 |
+
The `contiguous_iterator` concept provides a guarantee that the denoted
|
| 4 |
+
elements are stored contiguously in memory.
|
| 5 |
+
|
| 6 |
+
``` cpp
|
| 7 |
+
template<class I>
|
| 8 |
+
concept contiguous_iterator =
|
| 9 |
+
random_access_iterator<I> &&
|
| 10 |
+
derived_from<ITER_CONCEPT(I), contiguous_iterator_tag> &&
|
| 11 |
+
is_lvalue_reference_v<iter_reference_t<I>> &&
|
| 12 |
+
same_as<iter_value_t<I>, remove_cvref_t<iter_reference_t<I>>> &&
|
| 13 |
+
requires(const I& i) {
|
| 14 |
+
{ to_address(i) } -> same_as<add_pointer_t<iter_reference_t<I>>>;
|
| 15 |
+
};
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
Let `a` and `b` be dereferenceable iterators and `c` be a
|
| 19 |
+
non-dereferenceable iterator of type `I` such that `b` is reachable from
|
| 20 |
+
`a` and `c` is reachable from `b`, and let `D` be
|
| 21 |
+
`iter_difference_t<I>`. The type `I` models `contiguous_iterator` only
|
| 22 |
+
if
|
| 23 |
+
|
| 24 |
+
- `to_address(a) == addressof(*a)`,
|
| 25 |
+
- `to_address(b) == to_address(a) + D(b - a)`, and
|
| 26 |
+
- `to_address(c) == to_address(a) + D(c - a)`.
|
| 27 |
+
|