tmp/tmp0zp7fgkr/{from.md → to.md}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
### Sized ranges <a id="range.sized">[[range.sized]]</a>
|
| 2 |
|
| 3 |
-
The `sized_range` concept refines `
|
| 4 |
-
number of elements in the range can be determined
|
| 5 |
-
time using `ranges::size`.
|
| 6 |
|
| 7 |
``` cpp
|
| 8 |
template<class T>
|
| 9 |
concept sized_range =
|
| 10 |
-
|
| 11 |
```
|
| 12 |
|
| 13 |
Given an lvalue `t` of type `remove_reference_t<T>`, `T` models
|
| 14 |
`sized_range` only if
|
| 15 |
|
|
@@ -31,9 +31,9 @@ template<class>
|
|
| 31 |
*Remarks:* Pursuant to [[namespace.std]], users may specialize
|
| 32 |
`disable_sized_range` for cv-unqualified program-defined types. Such
|
| 33 |
specializations shall be usable in constant expressions [[expr.const]]
|
| 34 |
and have type `const bool`.
|
| 35 |
|
| 36 |
-
[*Note 1*: `disable_sized_range` allows use of range types with the
|
| 37 |
library that satisfy but do not in fact model
|
| 38 |
`sized_range`. — *end note*]
|
| 39 |
|
|
|
|
| 1 |
### Sized ranges <a id="range.sized">[[range.sized]]</a>
|
| 2 |
|
| 3 |
+
The `sized_range` concept refines `approximately_sized_range` with the
|
| 4 |
+
requirement that the number of elements in the range can be determined
|
| 5 |
+
in amortized constant time using `ranges::size`.
|
| 6 |
|
| 7 |
``` cpp
|
| 8 |
template<class T>
|
| 9 |
concept sized_range =
|
| 10 |
+
approximately_sized_range<T> && requires(T& t) { ranges::size(t); };
|
| 11 |
```
|
| 12 |
|
| 13 |
Given an lvalue `t` of type `remove_reference_t<T>`, `T` models
|
| 14 |
`sized_range` only if
|
| 15 |
|
|
|
|
| 31 |
*Remarks:* Pursuant to [[namespace.std]], users may specialize
|
| 32 |
`disable_sized_range` for cv-unqualified program-defined types. Such
|
| 33 |
specializations shall be usable in constant expressions [[expr.const]]
|
| 34 |
and have type `const bool`.
|
| 35 |
|
| 36 |
+
[*Note 1*: `disable_sized_range` allows use of `range` types with the
|
| 37 |
library that satisfy but do not in fact model
|
| 38 |
`sized_range`. — *end note*]
|
| 39 |
|