tmp/tmpmh4nz5_6/{from.md → to.md}
RENAMED
|
@@ -1,32 +1,39 @@
|
|
| 1 |
### Fill <a id="alg.fill">[[alg.fill]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class ForwardIterator, class T>
|
| 5 |
-
void fill(ForwardIterator first, ForwardIterator last, const T& value);
|
| 6 |
template<class ExecutionPolicy, class ForwardIterator, class T>
|
| 7 |
void fill(ExecutionPolicy&& exec,
|
| 8 |
ForwardIterator first, ForwardIterator last, const T& value);
|
| 9 |
|
| 10 |
template<class OutputIterator, class Size, class T>
|
| 11 |
-
OutputIterator fill_n(OutputIterator first, Size n, const T& value);
|
| 12 |
template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
|
| 13 |
ForwardIterator fill_n(ExecutionPolicy&& exec,
|
| 14 |
ForwardIterator first, Size n, const T& value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
```
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
The type `Size` shall be convertible to an integral
|
| 20 |
-
type ([[conv.integral]], [[class.conv]]).
|
| 21 |
|
| 22 |
-
*
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
-
*
|
| 28 |
-
|
| 29 |
|
| 30 |
-
*
|
| 31 |
-
|
|
|
|
| 32 |
|
|
|
|
| 1 |
### Fill <a id="alg.fill">[[alg.fill]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class ForwardIterator, class T>
|
| 5 |
+
constexpr void fill(ForwardIterator first, ForwardIterator last, const T& value);
|
| 6 |
template<class ExecutionPolicy, class ForwardIterator, class T>
|
| 7 |
void fill(ExecutionPolicy&& exec,
|
| 8 |
ForwardIterator first, ForwardIterator last, const T& value);
|
| 9 |
|
| 10 |
template<class OutputIterator, class Size, class T>
|
| 11 |
+
constexpr OutputIterator fill_n(OutputIterator first, Size n, const T& value);
|
| 12 |
template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
|
| 13 |
ForwardIterator fill_n(ExecutionPolicy&& exec,
|
| 14 |
ForwardIterator first, Size n, const T& value);
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
template<class T, output_iterator<const T&> O, sentinel_for<O> S>
|
| 18 |
+
constexpr O ranges::fill(O first, S last, const T& value);
|
| 19 |
+
template<class T, output_range<const T&> R>
|
| 20 |
+
constexpr borrowed_iterator_t<R> ranges::fill(R&& r, const T& value);
|
| 21 |
+
template<class T, output_iterator<const T&> O>
|
| 22 |
+
constexpr O ranges::fill_n(O first, iter_difference_t<O> n, const T& value);
|
| 23 |
```
|
| 24 |
|
| 25 |
+
Let N be max(0, `n`) for the `fill_n` algorithms, and `last - first` for
|
| 26 |
+
the `fill` algorithms.
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
*Mandates:* The expression `value` is
|
| 29 |
+
writable [[iterator.requirements.general]] to the output iterator. The
|
| 30 |
+
type `Size` is convertible to an integral type ([[conv.integral]],
|
| 31 |
+
[[class.conv]]).
|
| 32 |
|
| 33 |
+
*Effects:* Assigns `value` through all the iterators in the range
|
| 34 |
+
\[`first`, `first + `N).
|
| 35 |
|
| 36 |
+
*Returns:* `first + `N.
|
| 37 |
+
|
| 38 |
+
*Complexity:* Exactly N assignments.
|
| 39 |
|