From Jason Turner

[uninitialized.fill]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp1hzh5ybc/{from.md → to.md} +45 -12
tmp/tmp1hzh5ybc/{from.md → to.md} RENAMED
@@ -1,30 +1,63 @@
1
- #### `uninitialized_fill` <a id="uninitialized.fill">[[uninitialized.fill]]</a>
2
 
3
  ``` cpp
4
- template <class ForwardIterator, class T>
5
- void uninitialized_fill(ForwardIterator first, ForwardIterator last,
6
- const T& x);
7
  ```
8
 
9
- *Effects:* As if by:
10
 
11
  ``` cpp
12
  for (; first != last; ++first)
13
- ::new (static_cast<void*>(addressof(*first)))
14
- typename iterator_traits<ForwardIterator>::value_type(x);
15
  ```
16
 
17
  ``` cpp
18
- template <class ForwardIterator, class Size, class T>
19
- ForwardIterator uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
 
 
 
 
 
 
20
  ```
21
 
22
- *Effects:* As if by:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  ``` cpp
25
  for (; n--; ++first)
26
- ::new (static_cast<void*>(addressof(*first)))
27
- typename iterator_traits<ForwardIterator>::value_type(x);
28
  return first;
29
  ```
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### `uninitialized_fill` <a id="uninitialized.fill">[[uninitialized.fill]]</a>
2
 
3
  ``` cpp
4
+ template<class NoThrowForwardIterator, class T>
5
+ void uninitialized_fill(NoThrowForwardIterator first, NoThrowForwardIterator last, const T& x);
 
6
  ```
7
 
8
+ *Effects:* Equivalent to:
9
 
10
  ``` cpp
11
  for (; first != last; ++first)
12
+ ::new (voidify(*first))
13
+ typename iterator_traits<NoThrowForwardIterator>::value_type(x);
14
  ```
15
 
16
  ``` cpp
17
+ namespace ranges {
18
+ template<no-throw-forward-iterator I, no-throw-sentinel<I> S, class T>
19
+ requires constructible_from<iter_value_t<I>, const T&>
20
+ I uninitialized_fill(I first, S last, const T& x);
21
+ template<no-throw-forward-range R, class T>
22
+ requires constructible_from<range_value_t<R>, const T&>
23
+ borrowed_iterator_t<R> uninitialized_fill(R&& r, const T& x);
24
+ }
25
  ```
26
 
27
+ *Effects:* Equivalent to:
28
+
29
+ ``` cpp
30
+ for (; first != last; ++first) {
31
+ ::new (voidify(*first)) remove_reference_t<iter_reference_t<I>>(x);
32
+ }
33
+ return first;
34
+ ```
35
+
36
+ ``` cpp
37
+ template<class NoThrowForwardIterator, class Size, class T>
38
+ NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x);
39
+ ```
40
+
41
+ *Effects:* Equivalent to:
42
 
43
  ``` cpp
44
  for (; n--; ++first)
45
+ ::new (voidify(*first))
46
+ typename iterator_traits<NoThrowForwardIterator>::value_type(x);
47
  return first;
48
  ```
49
 
50
+ ``` cpp
51
+ namespace ranges {
52
+ template<no-throw-forward-iterator I, class T>
53
+ requires constructible_from<iter_value_t<I>, const T&>
54
+ I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x);
55
+ }
56
+ ```
57
+
58
+ *Effects:* Equivalent to:
59
+
60
+ ``` cpp
61
+ return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base();
62
+ ```
63
+