From Jason Turner

[uninitialized.construct.value]

Diff to HTML by rtfpessoa

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