tmp/tmpo17bt57y/{from.md → to.md}
RENAMED
|
@@ -12,5 +12,24 @@ expression `++val`, where `val` has type `T`, is well-formed.
|
|
| 12 |
\[`first`, `last`), assigns `*i = value` and increments `value` as if by
|
| 13 |
`++value`.
|
| 14 |
|
| 15 |
*Complexity:* Exactly `last - first` increments and assignments.
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
\[`first`, `last`), assigns `*i = value` and increments `value` as if by
|
| 13 |
`++value`.
|
| 14 |
|
| 15 |
*Complexity:* Exactly `last - first` increments and assignments.
|
| 16 |
|
| 17 |
+
``` cpp
|
| 18 |
+
template<input_or_output_iterator O, sentinel_for<O> S, weakly_incrementable T>
|
| 19 |
+
requires indirectly_writable<O, const T&>
|
| 20 |
+
constexpr ranges::iota_result<O, T> ranges::iota(O first, S last, T value);
|
| 21 |
+
template<weakly_incrementable T, output_range<const T&> R>
|
| 22 |
+
constexpr ranges::iota_result<borrowed_iterator_t<R>, T> ranges::iota(R&& r, T value);
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
*Effects:* Equivalent to:
|
| 26 |
+
|
| 27 |
+
``` cpp
|
| 28 |
+
while (first != last) {
|
| 29 |
+
*first = as_const(value);
|
| 30 |
+
++first;
|
| 31 |
+
++value;
|
| 32 |
+
}
|
| 33 |
+
return {std::move(first), std::move(value)};
|
| 34 |
+
```
|
| 35 |
+
|