tmp/tmpfa39vz07/{from.md → to.md}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
### Class `any` <a id="any.class">[[any.class]]</a>
|
| 2 |
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
class any {
|
| 6 |
public:
|
| 7 |
// [any.cons], construction and destruction
|
|
@@ -118,13 +120,12 @@ Let `VT` be `decay_t<T>`.
|
|
| 118 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 119 |
`is_constructible_v<VT, Args...>` is `true`.
|
| 120 |
|
| 121 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 122 |
|
| 123 |
-
*Effects:*
|
| 124 |
-
|
| 125 |
-
`std::forward<Args>(args)...`.
|
| 126 |
|
| 127 |
*Ensures:* `*this` contains a value of type `VT`.
|
| 128 |
|
| 129 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 130 |
|
|
@@ -138,13 +139,12 @@ Let `VT` be `decay_t<T>`.
|
|
| 138 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 139 |
`is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
|
| 140 |
|
| 141 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 142 |
|
| 143 |
-
*Effects:*
|
| 144 |
-
|
| 145 |
-
`il, std::forward<Args>(args)...`.
|
| 146 |
|
| 147 |
*Ensures:* `*this` contains a value.
|
| 148 |
|
| 149 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 150 |
|
|
@@ -172,15 +172,15 @@ contained value.
|
|
| 172 |
any& operator=(any&& rhs) noexcept;
|
| 173 |
```
|
| 174 |
|
| 175 |
*Effects:* As if by `any(std::move(rhs)).swap(*this)`.
|
| 176 |
|
| 177 |
-
*Returns:* `*this`.
|
| 178 |
-
|
| 179 |
*Ensures:* The state of `*this` is equivalent to the original state of
|
| 180 |
`rhs`.
|
| 181 |
|
|
|
|
|
|
|
| 182 |
``` cpp
|
| 183 |
template<class T>
|
| 184 |
any& operator=(T&& rhs);
|
| 185 |
```
|
| 186 |
|
|
@@ -211,13 +211,12 @@ Let `VT` be `decay_t<T>`.
|
|
| 211 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 212 |
`is_constructible_v<VT, Args...>` is `true`.
|
| 213 |
|
| 214 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 215 |
|
| 216 |
-
*Effects:* Calls `reset()`. Then initializes the
|
| 217 |
-
|
| 218 |
-
`std::forward<Args>(args)...`.
|
| 219 |
|
| 220 |
*Ensures:* `*this` contains a value.
|
| 221 |
|
| 222 |
*Returns:* A reference to the new contained value.
|
| 223 |
|
|
@@ -237,13 +236,12 @@ Let `VT` be `decay_t<T>`.
|
|
| 237 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 238 |
`is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
|
| 239 |
|
| 240 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 241 |
|
| 242 |
-
*Effects:* Calls `reset()`. Then initializes the
|
| 243 |
-
|
| 244 |
-
`il, std::forward<Args>(args)...`.
|
| 245 |
|
| 246 |
*Ensures:* `*this` contains a value.
|
| 247 |
|
| 248 |
*Returns:* A reference to the new contained value.
|
| 249 |
|
|
|
|
| 1 |
### Class `any` <a id="any.class">[[any.class]]</a>
|
| 2 |
|
| 3 |
+
#### General <a id="any.class.general">[[any.class.general]]</a>
|
| 4 |
+
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
class any {
|
| 8 |
public:
|
| 9 |
// [any.cons], construction and destruction
|
|
|
|
| 120 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 121 |
`is_constructible_v<VT, Args...>` is `true`.
|
| 122 |
|
| 123 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 124 |
|
| 125 |
+
*Effects:* Direct-non-list-initializes the contained value of type `VT`
|
| 126 |
+
with `std::forward<Args>(args)...`.
|
|
|
|
| 127 |
|
| 128 |
*Ensures:* `*this` contains a value of type `VT`.
|
| 129 |
|
| 130 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 131 |
|
|
|
|
| 139 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 140 |
`is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
|
| 141 |
|
| 142 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 143 |
|
| 144 |
+
*Effects:* Direct-non-list-initializes the contained value of type `VT`
|
| 145 |
+
with `il, std::forward<Args>(args)...`.
|
|
|
|
| 146 |
|
| 147 |
*Ensures:* `*this` contains a value.
|
| 148 |
|
| 149 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 150 |
|
|
|
|
| 172 |
any& operator=(any&& rhs) noexcept;
|
| 173 |
```
|
| 174 |
|
| 175 |
*Effects:* As if by `any(std::move(rhs)).swap(*this)`.
|
| 176 |
|
|
|
|
|
|
|
| 177 |
*Ensures:* The state of `*this` is equivalent to the original state of
|
| 178 |
`rhs`.
|
| 179 |
|
| 180 |
+
*Returns:* `*this`.
|
| 181 |
+
|
| 182 |
``` cpp
|
| 183 |
template<class T>
|
| 184 |
any& operator=(T&& rhs);
|
| 185 |
```
|
| 186 |
|
|
|
|
| 211 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 212 |
`is_constructible_v<VT, Args...>` is `true`.
|
| 213 |
|
| 214 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 215 |
|
| 216 |
+
*Effects:* Calls `reset()`. Then direct-non-list-initializes the
|
| 217 |
+
contained value of type `VT` with `std::forward<Args>(args)...`.
|
|
|
|
| 218 |
|
| 219 |
*Ensures:* `*this` contains a value.
|
| 220 |
|
| 221 |
*Returns:* A reference to the new contained value.
|
| 222 |
|
|
|
|
| 236 |
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 237 |
`is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
|
| 238 |
|
| 239 |
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 240 |
|
| 241 |
+
*Effects:* Calls `reset()`. Then direct-non-list-initializes the
|
| 242 |
+
contained value of type `VT` with `il, std::forward<Args>(args)...`.
|
|
|
|
| 243 |
|
| 244 |
*Ensures:* `*this` contains a value.
|
| 245 |
|
| 246 |
*Returns:* A reference to the new contained value.
|
| 247 |
|