tmp/tmp8u1_gs1d/{from.md → to.md}
RENAMED
|
@@ -2,29 +2,33 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
pointer release() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
-
`get() == nullptr`.
|
| 8 |
|
| 9 |
*Returns:* The value `get()` had at the start of the call to `release`.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
void reset(pointer p = pointer()) noexcept;
|
| 13 |
```
|
| 14 |
|
| 15 |
*Requires:* The expression `get_deleter()(get())` shall be well formed,
|
| 16 |
shall have well-defined behavior, and shall not throw exceptions.
|
| 17 |
|
| 18 |
-
*Effects:*
|
| 19 |
-
of the stored pointer, `old_p`, was not equal to
|
| 20 |
-
`get_deleter()(old_p)`.
|
| 21 |
-
because the call to `get_deleter()` may destroy `*this`.
|
| 22 |
|
| 23 |
-
*
|
| 24 |
-
call to `get_deleter()`
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
void swap(unique_ptr& u) noexcept;
|
| 29 |
```
|
| 30 |
|
|
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
pointer release() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
+
*Postconditions:* `get() == nullptr`.
|
| 8 |
|
| 9 |
*Returns:* The value `get()` had at the start of the call to `release`.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
void reset(pointer p = pointer()) noexcept;
|
| 13 |
```
|
| 14 |
|
| 15 |
*Requires:* The expression `get_deleter()(get())` shall be well formed,
|
| 16 |
shall have well-defined behavior, and shall not throw exceptions.
|
| 17 |
|
| 18 |
+
*Effects:* Assigns `p` to the stored pointer, and then if and only if
|
| 19 |
+
the old value of the stored pointer, `old_p`, was not equal to
|
| 20 |
+
`nullptr`, calls `get_deleter()(old_p)`.
|
|
|
|
| 21 |
|
| 22 |
+
[*Note 5*: The order of these operations is significant because the
|
| 23 |
+
call to `get_deleter()` may destroy `*this`. — *end note*]
|
| 24 |
+
|
| 25 |
+
*Postconditions:* `get() == p`.
|
| 26 |
+
|
| 27 |
+
[*Note 6*: The postcondition does not hold if the call to
|
| 28 |
+
`get_deleter()` destroys `*this` since `this->get()` is no longer a
|
| 29 |
+
valid expression. — *end note*]
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
void swap(unique_ptr& u) noexcept;
|
| 33 |
```
|
| 34 |
|