tmp/tmpe6e72utg/{from.md → to.md}
RENAMED
|
@@ -5,60 +5,62 @@ template <class T, class... Args>
|
|
| 5 |
decay_t<T>& emplace(Args&&... args);
|
| 6 |
```
|
| 7 |
|
| 8 |
Let `VT` be `decay_t<T>`.
|
| 9 |
|
| 10 |
-
*
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
*Effects:* Calls `reset()`. Then initializes the contained value as if
|
| 13 |
direct-non-list-initializing an object of type `VT` with the arguments
|
| 14 |
`std::forward<Args>(args)...`.
|
| 15 |
|
| 16 |
-
*
|
| 17 |
|
| 18 |
*Returns:* A reference to the new contained value.
|
| 19 |
|
| 20 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 21 |
|
| 22 |
*Remarks:* If an exception is thrown during the call to `VT`’s
|
| 23 |
constructor, `*this` does not contain a value, and any previously
|
| 24 |
-
contained value has been destroyed.
|
| 25 |
-
in overload resolution unless `is_copy_constructible_v<VT>` is `true`
|
| 26 |
-
and `is_constructible_v<VT, Args...>` is `true`.
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
template<class T, class U, class... Args>
|
| 30 |
decay_t<T>& emplace(initializer_list<U> il, Args&&... args);
|
| 31 |
```
|
| 32 |
|
| 33 |
Let `VT` be `decay_t<T>`.
|
| 34 |
|
| 35 |
-
*
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
*Effects:* Calls `reset()`. Then initializes the contained value as if
|
| 38 |
direct-non-list-initializing an object of type `VT` with the arguments
|
| 39 |
`il, std::forward<Args>(args)...`.
|
| 40 |
|
| 41 |
-
*
|
| 42 |
|
| 43 |
*Returns:* A reference to the new contained value.
|
| 44 |
|
| 45 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 46 |
|
| 47 |
*Remarks:* If an exception is thrown during the call to `VT`’s
|
| 48 |
constructor, `*this` does not contain a value, and any previously
|
| 49 |
-
contained value has been destroyed.
|
| 50 |
-
in overload resolution unless `is_copy_constructible_v<VT>` is `true`
|
| 51 |
-
and `is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
void reset() noexcept;
|
| 55 |
```
|
| 56 |
|
| 57 |
*Effects:* If `has_value()` is `true`, destroys the contained value.
|
| 58 |
|
| 59 |
-
*
|
| 60 |
|
| 61 |
``` cpp
|
| 62 |
void swap(any& rhs) noexcept;
|
| 63 |
```
|
| 64 |
|
|
|
|
| 5 |
decay_t<T>& emplace(Args&&... args);
|
| 6 |
```
|
| 7 |
|
| 8 |
Let `VT` be `decay_t<T>`.
|
| 9 |
|
| 10 |
+
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 11 |
+
`is_constructible_v<VT, Args...>` is `true`.
|
| 12 |
+
|
| 13 |
+
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 14 |
|
| 15 |
*Effects:* Calls `reset()`. Then initializes the contained value as if
|
| 16 |
direct-non-list-initializing an object of type `VT` with the arguments
|
| 17 |
`std::forward<Args>(args)...`.
|
| 18 |
|
| 19 |
+
*Ensures:* `*this` contains a value.
|
| 20 |
|
| 21 |
*Returns:* A reference to the new contained value.
|
| 22 |
|
| 23 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 24 |
|
| 25 |
*Remarks:* If an exception is thrown during the call to `VT`’s
|
| 26 |
constructor, `*this` does not contain a value, and any previously
|
| 27 |
+
contained value has been destroyed.
|
|
|
|
|
|
|
| 28 |
|
| 29 |
``` cpp
|
| 30 |
template<class T, class U, class... Args>
|
| 31 |
decay_t<T>& emplace(initializer_list<U> il, Args&&... args);
|
| 32 |
```
|
| 33 |
|
| 34 |
Let `VT` be `decay_t<T>`.
|
| 35 |
|
| 36 |
+
*Constraints:* `is_copy_constructible_v<VT>` is `true` and
|
| 37 |
+
`is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
|
| 38 |
+
|
| 39 |
+
*Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
|
| 40 |
|
| 41 |
*Effects:* Calls `reset()`. Then initializes the contained value as if
|
| 42 |
direct-non-list-initializing an object of type `VT` with the arguments
|
| 43 |
`il, std::forward<Args>(args)...`.
|
| 44 |
|
| 45 |
+
*Ensures:* `*this` contains a value.
|
| 46 |
|
| 47 |
*Returns:* A reference to the new contained value.
|
| 48 |
|
| 49 |
*Throws:* Any exception thrown by the selected constructor of `VT`.
|
| 50 |
|
| 51 |
*Remarks:* If an exception is thrown during the call to `VT`’s
|
| 52 |
constructor, `*this` does not contain a value, and any previously
|
| 53 |
+
contained value has been destroyed.
|
|
|
|
|
|
|
| 54 |
|
| 55 |
``` cpp
|
| 56 |
void reset() noexcept;
|
| 57 |
```
|
| 58 |
|
| 59 |
*Effects:* If `has_value()` is `true`, destroys the contained value.
|
| 60 |
|
| 61 |
+
*Ensures:* `has_value()` is `false`.
|
| 62 |
|
| 63 |
``` cpp
|
| 64 |
void swap(any& rhs) noexcept;
|
| 65 |
```
|
| 66 |
|