tmp/tmplg770hrf/{from.md → to.md}
RENAMED
|
@@ -1,38 +1,37 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
constexpr weak_ptr() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Constructs an empty `weak_ptr` object.
|
| 8 |
|
| 9 |
-
*
|
| 10 |
|
| 11 |
``` cpp
|
| 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 `r`
|
| 22 |
and stores a copy of the pointer stored in `r`.
|
| 23 |
|
| 24 |
-
*
|
| 25 |
|
| 26 |
``` cpp
|
| 27 |
weak_ptr(weak_ptr&& r) noexcept;
|
| 28 |
template<class Y> weak_ptr(weak_ptr<Y>&& r) noexcept;
|
| 29 |
```
|
| 30 |
|
| 31 |
-
*
|
| 32 |
-
resolution unless `Y*` is compatible with `T*`.
|
| 33 |
|
| 34 |
*Effects:* Move constructs a `weak_ptr` instance from `r`.
|
| 35 |
|
| 36 |
-
*
|
| 37 |
-
|
| 38 |
|
|
|
|
| 1 |
+
#### Constructors <a id="util.smartptr.weak.const">[[util.smartptr.weak.const]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
constexpr weak_ptr() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Constructs an empty `weak_ptr` object.
|
| 8 |
|
| 9 |
+
*Ensures:* `use_count() == 0`.
|
| 10 |
|
| 11 |
``` cpp
|
| 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 |
+
*Constraints:* For the second and third constructors, `Y*` is compatible
|
| 18 |
+
with `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 `r`
|
| 22 |
and stores a copy of the pointer stored in `r`.
|
| 23 |
|
| 24 |
+
*Ensures:* `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 |
+
*Constraints:* For the second constructor, `Y*` is compatible with `T*`.
|
|
|
|
| 32 |
|
| 33 |
*Effects:* Move constructs a `weak_ptr` instance from `r`.
|
| 34 |
|
| 35 |
+
*Ensures:* `*this` shall contain the old value of `r`. `r` shall be
|
| 36 |
+
empty. `r.use_count() == 0`.
|
| 37 |
|