tmp/tmphpilnone/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Specialized algorithms <a id="optional.specalg">[[optional.specalg]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template <class T> void swap(optional<T>& x, optional<T>& y) noexcept(noexcept(x.swap(y)));
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Effects:* Calls `x.swap(y)`.
|
| 8 |
+
|
| 9 |
+
*Remarks:* This function shall not participate in overload resolution
|
| 10 |
+
unless `is_move_constructible_v<T>` is `true` and `is_swappable_v<T>` is
|
| 11 |
+
`true`.
|
| 12 |
+
|
| 13 |
+
``` cpp
|
| 14 |
+
template <class T> constexpr optional<decay_t<T>> make_optional(T&& v);
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
*Returns:* `optional<decay_t<T>>(std::forward<T>(v))`.
|
| 18 |
+
|
| 19 |
+
``` cpp
|
| 20 |
+
template <class T, class...Args>
|
| 21 |
+
constexpr optional<T> make_optional(Args&&... args);
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
*Effects:* Equivalent to:
|
| 25 |
+
`return optional<T>(in_place, std::forward<Args>(args)...);`
|
| 26 |
+
|
| 27 |
+
``` cpp
|
| 28 |
+
template <class T, class U, class... Args>
|
| 29 |
+
constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
*Effects:* Equivalent to:
|
| 33 |
+
`return optional<T>(in_place, il, std::forward<Args>(args)...);`
|
| 34 |
+
|