From Jason Turner

[alg.fill]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpmh4nz5_6/{from.md → to.md} +21 -14
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
- *Requires:* The expression `value` shall be
18
- writable ([[iterator.requirements.general]]) to the output iterator.
19
- The type `Size` shall be convertible to an integral
20
- type ([[conv.integral]], [[class.conv]]).
21
 
22
- *Effects:* The `fill` algorithms assign `value` through all the
23
- iterators in the range \[`first`, `last`). The `fill_n` algorithms
24
- assign `value` through all the iterators in the range \[`first`,
25
- `first + n`) if `n` is positive, otherwise they do nothing.
26
 
27
- *Returns:* `fill_n` returns `first + n` for non-negative values of `n`
28
- and `first` for negative values.
29
 
30
- *Complexity:* Exactly `last - first`, `n`, or 0 assignments,
31
- respectively.
 
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