tmp/tmp8o5srii9/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Assignment <a id="optional.ref.assign">[[optional.ref.assign]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
constexpr optional& operator=(nullopt_t) noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Effects:* Assigns `nullptr` to *val*.
|
| 8 |
+
|
| 9 |
+
*Ensures:* `*this` does not contain a value.
|
| 10 |
+
|
| 11 |
+
*Returns:* `*this`.
|
| 12 |
+
|
| 13 |
+
``` cpp
|
| 14 |
+
template<class U>
|
| 15 |
+
constexpr T& emplace(U&& u) noexcept(is_nothrow_constructible_v<T&, U>);
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
*Constraints:*
|
| 19 |
+
|
| 20 |
+
- `is_constructible_v<T&, U>` is `true`, and
|
| 21 |
+
- `reference_constructs_from_temporary_v<T&, U>` is `false`.
|
| 22 |
+
|
| 23 |
+
*Effects:* Equivalent to:
|
| 24 |
+
*`convert-ref-init-val`*`(std::forward<U>(u))`.
|
| 25 |
+
|
| 26 |
+
*Returns:* `*`*`val`*.
|
| 27 |
+
|