tmp/tmptdpabn4u/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
##### `shared_ptr` assignment <a id="util.smartptr.shared.assign">[[util.smartptr.shared.assign]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
shared_ptr& operator=(const shared_ptr& r) noexcept;
|
| 5 |
template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r) noexcept;
|
| 6 |
-
template<class Y> shared_ptr& operator=(auto_ptr<Y>&& r);
|
| 7 |
```
|
| 8 |
|
| 9 |
*Effects:* Equivalent to `shared_ptr(r).swap(*this)`.
|
| 10 |
|
| 11 |
*Returns:* `*this`.
|
| 12 |
|
|
|
|
|
|
|
| 13 |
The use count updates caused by the temporary object construction and
|
| 14 |
destruction are not observable side effects, so the implementation may
|
| 15 |
meet the effects (and the implied guarantees) via different means,
|
| 16 |
without creating a temporary. In particular, in the example:
|
| 17 |
|
|
@@ -22,10 +23,12 @@ p = p;
|
|
| 22 |
q = p;
|
| 23 |
```
|
| 24 |
|
| 25 |
both assignments may be no-ops.
|
| 26 |
|
|
|
|
|
|
|
| 27 |
``` cpp
|
| 28 |
shared_ptr& operator=(shared_ptr&& r) noexcept;
|
| 29 |
template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r) noexcept;
|
| 30 |
```
|
| 31 |
|
|
@@ -37,7 +40,7 @@ template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r) noexcept;
|
|
| 37 |
template <class Y, class D> shared_ptr& operator=(unique_ptr<Y, D>&& r);
|
| 38 |
```
|
| 39 |
|
| 40 |
*Effects:* Equivalent to `shared_ptr(std::move(r)).swap(*this)`.
|
| 41 |
|
| 42 |
-
*Returns:* `*this`
|
| 43 |
|
|
|
|
| 1 |
##### `shared_ptr` assignment <a id="util.smartptr.shared.assign">[[util.smartptr.shared.assign]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
shared_ptr& operator=(const shared_ptr& r) noexcept;
|
| 5 |
template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r) noexcept;
|
|
|
|
| 6 |
```
|
| 7 |
|
| 8 |
*Effects:* Equivalent to `shared_ptr(r).swap(*this)`.
|
| 9 |
|
| 10 |
*Returns:* `*this`.
|
| 11 |
|
| 12 |
+
[*Note 3*:
|
| 13 |
+
|
| 14 |
The use count updates caused by the temporary object construction and
|
| 15 |
destruction are not observable side effects, so the implementation may
|
| 16 |
meet the effects (and the implied guarantees) via different means,
|
| 17 |
without creating a temporary. In particular, in the example:
|
| 18 |
|
|
|
|
| 23 |
q = p;
|
| 24 |
```
|
| 25 |
|
| 26 |
both assignments may be no-ops.
|
| 27 |
|
| 28 |
+
— *end note*]
|
| 29 |
+
|
| 30 |
``` cpp
|
| 31 |
shared_ptr& operator=(shared_ptr&& r) noexcept;
|
| 32 |
template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r) noexcept;
|
| 33 |
```
|
| 34 |
|
|
|
|
| 40 |
template <class Y, class D> shared_ptr& operator=(unique_ptr<Y, D>&& r);
|
| 41 |
```
|
| 42 |
|
| 43 |
*Effects:* Equivalent to `shared_ptr(std::move(r)).swap(*this)`.
|
| 44 |
|
| 45 |
+
*Returns:* `*this`.
|
| 46 |
|