tmp/tmpc28xgvwm/{from.md → to.md}
RENAMED
|
@@ -12,14 +12,27 @@ constexpr weak_ptr() noexcept;
|
|
| 12 |
weak_ptr(const weak_ptr& r) noexcept;
|
| 13 |
template<class Y> weak_ptr(const weak_ptr<Y>& r) noexcept;
|
| 14 |
template<class Y> weak_ptr(const shared_ptr<Y>& r) noexcept;
|
| 15 |
```
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
*Effects:* If `r` is *empty*, constructs an *empty* `weak_ptr` object;
|
| 21 |
otherwise, constructs a `weak_ptr` object that *shares ownership* with
|
| 22 |
`r` and stores a copy of the pointer stored in `r`.
|
| 23 |
|
| 24 |
*Postconditions:* `use_count() == r.use_count()`.
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
weak_ptr(const weak_ptr& r) noexcept;
|
| 13 |
template<class Y> weak_ptr(const weak_ptr<Y>& r) noexcept;
|
| 14 |
template<class Y> weak_ptr(const shared_ptr<Y>& r) noexcept;
|
| 15 |
```
|
| 16 |
|
| 17 |
+
The second and third constructors shall not participate in overload
|
| 18 |
+
resolution unless `Y*` is implicitly convertible to `T*`.
|
| 19 |
|
| 20 |
*Effects:* If `r` is *empty*, constructs an *empty* `weak_ptr` object;
|
| 21 |
otherwise, constructs a `weak_ptr` object that *shares ownership* with
|
| 22 |
`r` and stores a copy of the pointer stored in `r`.
|
| 23 |
|
| 24 |
*Postconditions:* `use_count() == r.use_count()`.
|
| 25 |
|
| 26 |
+
``` cpp
|
| 27 |
+
weak_ptr(weak_ptr&& r) noexcept;
|
| 28 |
+
template<class Y> weak_ptr(weak_ptr<Y>&& r) noexcept;
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
The second constructor shall not participate in overload resolution
|
| 32 |
+
unless `Y*` is implicitly convertible to `T*`.
|
| 33 |
+
|
| 34 |
+
*Effects:* Move-constructs a `weak_ptr` instance from `r`.
|
| 35 |
+
|
| 36 |
+
*Postconditions:* `*this` shall contain the old value of `r`. `r` shall
|
| 37 |
+
be *empty*. `r.use_count() == 0`.
|
| 38 |
+
|