tmp/tmp7dbj8hiq/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
##### Assignment <a id="unique.ptr.single.asgn">[[unique.ptr.single.asgn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
unique_ptr& operator=(unique_ptr&& u) noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
*Constraints:* `is_move_assignable_v<D>` is `true`.
|
| 8 |
|
| 9 |
*Preconditions:* If `D` is not a reference type, `D` meets the
|
|
@@ -14,16 +14,17 @@ meets the *Cpp17CopyAssignable* requirements and assignment of the
|
|
| 14 |
deleter from an lvalue of type `D` does not throw an exception.
|
| 15 |
|
| 16 |
*Effects:* Calls `reset(u.release())` followed by
|
| 17 |
`get_deleter() = std::forward<D>(u.get_deleter())`.
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
*Returns:* `*this`.
|
| 20 |
|
| 21 |
-
*Ensures:* `u.get() == nullptr`.
|
| 22 |
-
|
| 23 |
``` cpp
|
| 24 |
-
template<class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
|
| 25 |
```
|
| 26 |
|
| 27 |
*Constraints:*
|
| 28 |
|
| 29 |
- `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer`,
|
|
@@ -38,16 +39,16 @@ deleter from an lvalue of type `E` is well-formed and does not throw an
|
|
| 38 |
exception.
|
| 39 |
|
| 40 |
*Effects:* Calls `reset(u.release())` followed by
|
| 41 |
`get_deleter() = std::forward<E>(u.get_deleter())`.
|
| 42 |
|
| 43 |
-
*Returns:* `*this`.
|
| 44 |
-
|
| 45 |
*Ensures:* `u.get() == nullptr`.
|
| 46 |
|
|
|
|
|
|
|
| 47 |
``` cpp
|
| 48 |
-
unique_ptr& operator=(nullptr_t) noexcept;
|
| 49 |
```
|
| 50 |
|
| 51 |
*Effects:* As if by `reset()`.
|
| 52 |
|
| 53 |
*Ensures:* `get() == nullptr`.
|
|
|
|
| 1 |
##### Assignment <a id="unique.ptr.single.asgn">[[unique.ptr.single.asgn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
constexpr unique_ptr& operator=(unique_ptr&& u) noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
*Constraints:* `is_move_assignable_v<D>` is `true`.
|
| 8 |
|
| 9 |
*Preconditions:* If `D` is not a reference type, `D` meets the
|
|
|
|
| 14 |
deleter from an lvalue of type `D` does not throw an exception.
|
| 15 |
|
| 16 |
*Effects:* Calls `reset(u.release())` followed by
|
| 17 |
`get_deleter() = std::forward<D>(u.get_deleter())`.
|
| 18 |
|
| 19 |
+
*Ensures:* If `this != addressof(u)`, `u.get() == nullptr`, otherwise
|
| 20 |
+
`u.get()` is unchanged.
|
| 21 |
+
|
| 22 |
*Returns:* `*this`.
|
| 23 |
|
|
|
|
|
|
|
| 24 |
``` cpp
|
| 25 |
+
template<class U, class E> constexpr unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
|
| 26 |
```
|
| 27 |
|
| 28 |
*Constraints:*
|
| 29 |
|
| 30 |
- `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer`,
|
|
|
|
| 39 |
exception.
|
| 40 |
|
| 41 |
*Effects:* Calls `reset(u.release())` followed by
|
| 42 |
`get_deleter() = std::forward<E>(u.get_deleter())`.
|
| 43 |
|
|
|
|
|
|
|
| 44 |
*Ensures:* `u.get() == nullptr`.
|
| 45 |
|
| 46 |
+
*Returns:* `*this`.
|
| 47 |
+
|
| 48 |
``` cpp
|
| 49 |
+
constexpr unique_ptr& operator=(nullptr_t) noexcept;
|
| 50 |
```
|
| 51 |
|
| 52 |
*Effects:* As if by `reset()`.
|
| 53 |
|
| 54 |
*Ensures:* `get() == nullptr`.
|