From Jason Turner

[uninitialized.fill]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpj7w08nzp/{from.md → to.md} +16 -2
tmp/tmpj7w08nzp/{from.md → to.md} RENAMED
@@ -4,13 +4,27 @@
4
  template <class ForwardIterator, class T>
5
  void uninitialized_fill(ForwardIterator first, ForwardIterator last,
6
  const T& x);
7
  ```
8
 
9
- *Effects:*
10
 
11
  ``` cpp
12
  for (; first != last; ++first)
13
- ::new (static_cast<void*>(&*first))
14
  typename iterator_traits<ForwardIterator>::value_type(x);
15
  ```
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+