tmp/tmpnw1p04g4/{from.md → to.md}
RENAMED
|
@@ -4,16 +4,17 @@
|
|
| 4 |
~shared_ptr();
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:*
|
| 8 |
|
| 9 |
-
- If `*this` is
|
| 10 |
instance (`use_count() > 1`), there are no side effects.
|
| 11 |
-
- Otherwise, if `*this`
|
| 12 |
-
|
| 13 |
-
- Otherwise, `*this`
|
| 14 |
|
| 15 |
-
Since the destruction of `*this` decreases the number of
|
| 16 |
-
share ownership with `*this` by one, after `*this` has
|
| 17 |
-
all `shared_ptr` instances that shared ownership with
|
| 18 |
-
report a `use_count()` that is one less than its previous
|
|
|
|
| 19 |
|
|
|
|
| 4 |
~shared_ptr();
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:*
|
| 8 |
|
| 9 |
+
- If `*this` is empty or shares ownership with another `shared_ptr`
|
| 10 |
instance (`use_count() > 1`), there are no side effects.
|
| 11 |
+
- Otherwise, if `*this` owns an object `p` and a deleter `d`, `d(p)` is
|
| 12 |
+
called.
|
| 13 |
+
- Otherwise, `*this` owns a pointer `p`, and `delete p` is called.
|
| 14 |
|
| 15 |
+
[*Note 1*: Since the destruction of `*this` decreases the number of
|
| 16 |
+
instances that share ownership with `*this` by one, after `*this` has
|
| 17 |
+
been destroyed all `shared_ptr` instances that shared ownership with
|
| 18 |
+
`*this` will report a `use_count()` that is one less than its previous
|
| 19 |
+
value. — *end note*]
|
| 20 |
|