tmp/tmpyk3wvvuy/{from.md → to.md}
RENAMED
|
@@ -44,163 +44,166 @@ public:
|
|
| 44 |
using key_type = see below; // not present for set containers
|
| 45 |
using mapped_type = see below; // not present for set containers
|
| 46 |
using allocator_type = see below;
|
| 47 |
|
| 48 |
private:
|
| 49 |
-
using
|
| 50 |
-
using
|
| 51 |
|
| 52 |
-
typename
|
| 53 |
-
rebind_traits<
|
| 54 |
optional<allocator_type> alloc_; // exposition only
|
| 55 |
|
| 56 |
public:
|
| 57 |
// [container.node.cons], constructors, copy, and assignment
|
| 58 |
constexpr node-handle() noexcept : ptr_(), alloc_() {}
|
| 59 |
-
node-handle(node-handle&&) noexcept;
|
| 60 |
-
node-handle& operator=(node-handle&&);
|
| 61 |
|
| 62 |
// [container.node.dtor], destructor
|
| 63 |
-
~node-handle();
|
| 64 |
|
| 65 |
// [container.node.observers], observers
|
| 66 |
-
value_type& value() const;
|
| 67 |
key_type& key() const; // not present for set containers
|
| 68 |
-
mapped_type& mapped() const;
|
| 69 |
|
| 70 |
-
allocator_type get_allocator() const;
|
| 71 |
-
explicit operator bool() const noexcept;
|
| 72 |
-
|
| 73 |
|
| 74 |
// [container.node.modifiers], modifiers
|
| 75 |
-
void swap(node-handle&)
|
| 76 |
-
noexcept(
|
| 77 |
-
|
| 78 |
|
| 79 |
-
friend void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) {
|
| 80 |
x.swap(y);
|
| 81 |
}
|
| 82 |
};
|
| 83 |
```
|
| 84 |
|
| 85 |
#### Constructors, copy, and assignment <a id="container.node.cons">[[container.node.cons]]</a>
|
| 86 |
|
| 87 |
``` cpp
|
| 88 |
-
node-handle(node-handle&& nh) noexcept;
|
| 89 |
```
|
| 90 |
|
| 91 |
-
*Effects:* Constructs a *node-handle* object initializing
|
| 92 |
-
`nh.ptr_`. Move constructs
|
| 93 |
-
to `nh.ptr_` and assigns `nullopt` to `nh.alloc_`.
|
| 94 |
|
| 95 |
``` cpp
|
| 96 |
-
node-handle& operator=(node-handle&& nh);
|
| 97 |
```
|
| 98 |
|
| 99 |
-
*Preconditions:* Either `!alloc_`, or
|
| 100 |
-
`
|
| 101 |
-
or `alloc_ == nh.alloc_`.
|
| 102 |
|
| 103 |
*Effects:*
|
| 104 |
|
| 105 |
-
- If `ptr_ != nullptr`, destroys the `value_type`
|
| 106 |
-
|
| 107 |
-
`
|
| 108 |
-
|
| 109 |
-
-
|
| 110 |
-
-
|
| 111 |
-
|
| 112 |
-
`
|
| 113 |
-
|
|
|
|
|
|
|
| 114 |
|
| 115 |
*Returns:* `*this`.
|
| 116 |
|
| 117 |
*Throws:* Nothing.
|
| 118 |
|
| 119 |
#### Destructor <a id="container.node.dtor">[[container.node.dtor]]</a>
|
| 120 |
|
| 121 |
``` cpp
|
| 122 |
-
~node-handle();
|
| 123 |
```
|
| 124 |
|
| 125 |
-
*Effects:* If `ptr_ != nullptr`, destroys the `value_type`
|
| 126 |
-
the
|
| 127 |
-
`
|
| 128 |
-
`
|
| 129 |
|
| 130 |
#### Observers <a id="container.node.observers">[[container.node.observers]]</a>
|
| 131 |
|
| 132 |
``` cpp
|
| 133 |
-
value_type& value() const;
|
| 134 |
```
|
| 135 |
|
| 136 |
*Preconditions:* `empty() == false`.
|
| 137 |
|
| 138 |
*Returns:* A reference to the `value_type` subobject in the
|
| 139 |
-
|
| 140 |
|
| 141 |
*Throws:* Nothing.
|
| 142 |
|
| 143 |
``` cpp
|
| 144 |
key_type& key() const;
|
| 145 |
```
|
| 146 |
|
| 147 |
*Preconditions:* `empty() == false`.
|
| 148 |
|
| 149 |
*Returns:* A non-const reference to the `key_type` member of the
|
| 150 |
-
`value_type` subobject in the
|
| 151 |
-
|
| 152 |
|
| 153 |
*Throws:* Nothing.
|
| 154 |
|
| 155 |
*Remarks:* Modifying the key through the returned reference is
|
| 156 |
permitted.
|
| 157 |
|
| 158 |
``` cpp
|
| 159 |
-
mapped_type& mapped() const;
|
| 160 |
```
|
| 161 |
|
| 162 |
*Preconditions:* `empty() == false`.
|
| 163 |
|
| 164 |
*Returns:* A reference to the `mapped_type` member of the `value_type`
|
| 165 |
-
subobject in the
|
| 166 |
|
| 167 |
*Throws:* Nothing.
|
| 168 |
|
| 169 |
``` cpp
|
| 170 |
-
allocator_type get_allocator() const;
|
| 171 |
```
|
| 172 |
|
| 173 |
*Preconditions:* `empty() == false`.
|
| 174 |
|
| 175 |
-
*Returns:* `*alloc_`.
|
| 176 |
|
| 177 |
*Throws:* Nothing.
|
| 178 |
|
| 179 |
``` cpp
|
| 180 |
-
explicit operator bool() const noexcept;
|
| 181 |
```
|
| 182 |
|
| 183 |
-
*Returns:* `ptr_ != nullptr`.
|
| 184 |
|
| 185 |
``` cpp
|
| 186 |
-
|
| 187 |
```
|
| 188 |
|
| 189 |
-
*Returns:* `ptr_ == nullptr`.
|
| 190 |
|
| 191 |
#### Modifiers <a id="container.node.modifiers">[[container.node.modifiers]]</a>
|
| 192 |
|
| 193 |
``` cpp
|
| 194 |
-
void swap(node-handle& nh)
|
| 195 |
-
noexcept(
|
| 196 |
-
|
| 197 |
```
|
| 198 |
|
| 199 |
-
*Preconditions:* `!alloc_`, or `!nh.alloc_`, or
|
| 200 |
-
`
|
| 201 |
-
`alloc_ == nh.alloc_`.
|
| 202 |
|
| 203 |
-
*Effects:* Calls `swap(ptr_, nh.ptr_)`. If `!
|
| 204 |
-
or `
|
| 205 |
-
`
|
|
|
|
| 206 |
|
|
|
|
| 44 |
using key_type = see below; // not present for set containers
|
| 45 |
using mapped_type = see below; // not present for set containers
|
| 46 |
using allocator_type = see below;
|
| 47 |
|
| 48 |
private:
|
| 49 |
+
using container-node-type = unspecified; // exposition only
|
| 50 |
+
using ator-traits = allocator_traits<allocator_type>; // exposition only
|
| 51 |
|
| 52 |
+
typename ator-traits::template
|
| 53 |
+
rebind_traits<container-node-type>::pointer ptr_; // exposition only
|
| 54 |
optional<allocator_type> alloc_; // exposition only
|
| 55 |
|
| 56 |
public:
|
| 57 |
// [container.node.cons], constructors, copy, and assignment
|
| 58 |
constexpr node-handle() noexcept : ptr_(), alloc_() {}
|
| 59 |
+
constexpr node-handle(node-handle&&) noexcept;
|
| 60 |
+
constexpr node-handle& operator=(node-handle&&);
|
| 61 |
|
| 62 |
// [container.node.dtor], destructor
|
| 63 |
+
constexpr ~node-handle();
|
| 64 |
|
| 65 |
// [container.node.observers], observers
|
| 66 |
+
constexpr value_type& value() const; // not present for map containers
|
| 67 |
key_type& key() const; // not present for set containers
|
| 68 |
+
constexpr mapped_type& mapped() const; // not present for set containers
|
| 69 |
|
| 70 |
+
constexpr allocator_type get_allocator() const;
|
| 71 |
+
constexpr explicit operator bool() const noexcept;
|
| 72 |
+
constexpr bool empty() const noexcept;
|
| 73 |
|
| 74 |
// [container.node.modifiers], modifiers
|
| 75 |
+
constexpr void swap(node-handle&)
|
| 76 |
+
noexcept(ator-traits::propagate_on_container_swap::value ||
|
| 77 |
+
ator-traits::is_always_equal::value);
|
| 78 |
|
| 79 |
+
friend constexpr void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) {
|
| 80 |
x.swap(y);
|
| 81 |
}
|
| 82 |
};
|
| 83 |
```
|
| 84 |
|
| 85 |
#### Constructors, copy, and assignment <a id="container.node.cons">[[container.node.cons]]</a>
|
| 86 |
|
| 87 |
``` cpp
|
| 88 |
+
constexpr node-handle(node-handle&& nh) noexcept;
|
| 89 |
```
|
| 90 |
|
| 91 |
+
*Effects:* Constructs a *node-handle* object initializing *ptr\_* with
|
| 92 |
+
`nh.`*`ptr_`*. Move constructs *alloc\_* with `nh.`*`alloc_`*. Assigns
|
| 93 |
+
`nullptr` to `nh.`*`ptr_`* and assigns `nullopt` to `nh.`*`alloc_`*.
|
| 94 |
|
| 95 |
``` cpp
|
| 96 |
+
constexpr node-handle& operator=(node-handle&& nh);
|
| 97 |
```
|
| 98 |
|
| 99 |
+
*Preconditions:* Either `!`*`alloc_`* is `true`, or
|
| 100 |
+
*`ator-traits`*`::propagate_on_container_move_assignment::value` is
|
| 101 |
+
`true`, or *`alloc_`*` == nh.`*`alloc_`* is `true`.
|
| 102 |
|
| 103 |
*Effects:*
|
| 104 |
|
| 105 |
+
- If *`ptr_`*` != nullptr` is `true`, destroys the `value_type`
|
| 106 |
+
subobject in the *container-node-type* object pointed to by *ptr\_* by
|
| 107 |
+
calling *`ator-traits`*`::destroy`, then deallocates *ptr\_* by
|
| 108 |
+
calling
|
| 109 |
+
*`ator-traits`*`::template rebind_traits<`*`container-node-type`*`>::deallocate`.
|
| 110 |
+
- Assigns `nh.`*`ptr_`* to *ptr\_*.
|
| 111 |
+
- If `!`*`alloc_`* is `true` or
|
| 112 |
+
*`ator-traits`*`::propagate_on_container_move_assignment::value` is
|
| 113 |
+
`true`, move assigns `nh.`*`alloc_`* to *alloc\_*.
|
| 114 |
+
- Assigns `nullptr` to `nh.`*`ptr_`* and assigns `nullopt` to
|
| 115 |
+
`nh.`*`alloc_`*.
|
| 116 |
|
| 117 |
*Returns:* `*this`.
|
| 118 |
|
| 119 |
*Throws:* Nothing.
|
| 120 |
|
| 121 |
#### Destructor <a id="container.node.dtor">[[container.node.dtor]]</a>
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
+
constexpr ~node-handle();
|
| 125 |
```
|
| 126 |
|
| 127 |
+
*Effects:* If *`ptr_`*` != nullptr` is `true`, destroys the `value_type`
|
| 128 |
+
subobject in the *container-node-type* object pointed to by *ptr\_* by
|
| 129 |
+
calling *`ator-traits`*`::destroy`, then deallocates *ptr\_* by calling
|
| 130 |
+
*`ator-traits`*`::template rebind_traits<`*`container-node-type`*`>::deallocate`.
|
| 131 |
|
| 132 |
#### Observers <a id="container.node.observers">[[container.node.observers]]</a>
|
| 133 |
|
| 134 |
``` cpp
|
| 135 |
+
constexpr value_type& value() const;
|
| 136 |
```
|
| 137 |
|
| 138 |
*Preconditions:* `empty() == false`.
|
| 139 |
|
| 140 |
*Returns:* A reference to the `value_type` subobject in the
|
| 141 |
+
*container-node-type* object pointed to by *ptr\_*.
|
| 142 |
|
| 143 |
*Throws:* Nothing.
|
| 144 |
|
| 145 |
``` cpp
|
| 146 |
key_type& key() const;
|
| 147 |
```
|
| 148 |
|
| 149 |
*Preconditions:* `empty() == false`.
|
| 150 |
|
| 151 |
*Returns:* A non-const reference to the `key_type` member of the
|
| 152 |
+
`value_type` subobject in the *container-node-type* object pointed to by
|
| 153 |
+
*ptr\_*.
|
| 154 |
|
| 155 |
*Throws:* Nothing.
|
| 156 |
|
| 157 |
*Remarks:* Modifying the key through the returned reference is
|
| 158 |
permitted.
|
| 159 |
|
| 160 |
``` cpp
|
| 161 |
+
constexpr mapped_type& mapped() const;
|
| 162 |
```
|
| 163 |
|
| 164 |
*Preconditions:* `empty() == false`.
|
| 165 |
|
| 166 |
*Returns:* A reference to the `mapped_type` member of the `value_type`
|
| 167 |
+
subobject in the *container-node-type* object pointed to by *ptr\_*.
|
| 168 |
|
| 169 |
*Throws:* Nothing.
|
| 170 |
|
| 171 |
``` cpp
|
| 172 |
+
constexpr allocator_type get_allocator() const;
|
| 173 |
```
|
| 174 |
|
| 175 |
*Preconditions:* `empty() == false`.
|
| 176 |
|
| 177 |
+
*Returns:* `*`*`alloc_`*.
|
| 178 |
|
| 179 |
*Throws:* Nothing.
|
| 180 |
|
| 181 |
``` cpp
|
| 182 |
+
constexpr explicit operator bool() const noexcept;
|
| 183 |
```
|
| 184 |
|
| 185 |
+
*Returns:* *`ptr_`*` != nullptr`.
|
| 186 |
|
| 187 |
``` cpp
|
| 188 |
+
constexpr bool empty() const noexcept;
|
| 189 |
```
|
| 190 |
|
| 191 |
+
*Returns:* *`ptr_`*` == nullptr`.
|
| 192 |
|
| 193 |
#### Modifiers <a id="container.node.modifiers">[[container.node.modifiers]]</a>
|
| 194 |
|
| 195 |
``` cpp
|
| 196 |
+
constexpr void swap(node-handle& nh)
|
| 197 |
+
noexcept(ator-traits::propagate_on_container_swap::value ||
|
| 198 |
+
ator-traits::is_always_equal::value);
|
| 199 |
```
|
| 200 |
|
| 201 |
+
*Preconditions:* `!`*`alloc_`* is `true`, or `!nh.`*`alloc_`*, or
|
| 202 |
+
*`ator-traits`*`::propagate_on_container_swap::value` is `true`, or
|
| 203 |
+
*`alloc_`*` == nh.`*`alloc_`* is `true`.
|
| 204 |
|
| 205 |
+
*Effects:* Calls `swap(`*`ptr_`*`, nh.`*`ptr_`*`)`. If `!`*`alloc_`* is
|
| 206 |
+
`true`, or `!nh.`*`alloc_`* is `true`, or
|
| 207 |
+
*`ator-traits`*`::propagate_on_container_swap::value` is `true` calls
|
| 208 |
+
`swap(`*`alloc_`*`, nh.`*`alloc_`*`)`.
|
| 209 |
|