From Jason Turner

[depr.storage.iterator]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5ngo3qlf/{from.md → to.md} +0 -90
tmp/tmp5ngo3qlf/{from.md → to.md} RENAMED
@@ -1,90 +0,0 @@
1
- ## Raw storage iterator <a id="depr.storage.iterator">[[depr.storage.iterator]]</a>
2
-
3
- The header `<memory>` has the following addition:
4
-
5
- ``` cpp
6
- namespace std {
7
- template <class OutputIterator, class T>
8
- class raw_storage_iterator {
9
- public:
10
- using iterator_category = output_iterator_tag;
11
- using value_type = void;
12
- using difference_type = void;
13
- using pointer = void;
14
- using reference = void;
15
-
16
- explicit raw_storage_iterator(OutputIterator x);
17
-
18
- raw_storage_iterator& operator*();
19
- raw_storage_iterator& operator=(const T& element);
20
- raw_storage_iterator& operator=(T&& element);
21
- raw_storage_iterator& operator++();
22
- raw_storage_iterator operator++(int);
23
- OutputIterator base() const;
24
- };
25
- }
26
- ```
27
-
28
- `raw_storage_iterator` is provided to enable algorithms to store their
29
- results into uninitialized memory. The template parameter
30
- `OutputIterator` is required to have its `operator*` return an object
31
- for which `operator&` is defined and returns a pointer to `T`, and is
32
- also required to satisfy the requirements of an output iterator (
33
- [[output.iterators]]).
34
-
35
- ``` cpp
36
- explicit raw_storage_iterator(OutputIterator x);
37
- ```
38
-
39
- *Effects:* Initializes the iterator to point to the same value to which
40
- `x` points.
41
-
42
- ``` cpp
43
- raw_storage_iterator& operator*();
44
- ```
45
-
46
- *Returns:* `*this`
47
-
48
- ``` cpp
49
- raw_storage_iterator& operator=(const T& element);
50
- ```
51
-
52
- *Requires:* `T` shall be `CopyConstructible`.
53
-
54
- *Effects:* Constructs a value from `element` at the location to which
55
- the iterator points.
56
-
57
- *Returns:* A reference to the iterator.
58
-
59
- ``` cpp
60
- raw_storage_iterator& operator=(T&& element);
61
- ```
62
-
63
- *Requires:* `T` shall be `MoveConstructible`.
64
-
65
- *Effects:* Constructs a value from `std::move(element)` at the location
66
- to which the iterator points.
67
-
68
- *Returns:* A reference to the iterator.
69
-
70
- ``` cpp
71
- raw_storage_iterator& operator++();
72
- ```
73
-
74
- *Effects:* Pre-increment: advances the iterator and returns a reference
75
- to the updated iterator.
76
-
77
- ``` cpp
78
- raw_storage_iterator operator++(int);
79
- ```
80
-
81
- *Effects:* Post-increment: advances the iterator and returns the old
82
- value of the iterator.
83
-
84
- ``` cpp
85
- OutputIterator base() const;
86
- ```
87
-
88
- *Returns:* An iterator of type `OutputIterator` that points to the same
89
- value as `*this` points to.
90
-