tmp/tmpjeb9y8kz/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,13 @@
|
|
| 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;
|
|
@@ -15,13 +16,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
|
| 22 |
-
and stores a copy of the pointer stored
|
|
|
|
| 23 |
|
| 24 |
*Ensures:* `use_count() == r.use_count()`.
|
| 25 |
|
| 26 |
``` cpp
|
| 27 |
weak_ptr(weak_ptr&& r) noexcept;
|
|
@@ -30,8 +32,8 @@ template<class Y> weak_ptr(weak_ptr<Y>&& r) noexcept;
|
|
| 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`
|
| 36 |
-
|
| 37 |
|
|
|
|
| 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 that stores a null
|
| 8 |
+
pointer value.
|
| 9 |
|
| 10 |
*Ensures:* `use_count() == 0`.
|
| 11 |
|
| 12 |
``` cpp
|
| 13 |
weak_ptr(const weak_ptr& r) noexcept;
|
|
|
|
| 16 |
```
|
| 17 |
|
| 18 |
*Constraints:* For the second and third constructors, `Y*` is compatible
|
| 19 |
with `T*`.
|
| 20 |
|
| 21 |
+
*Effects:* If `r` is empty, constructs an empty `weak_ptr` object that
|
| 22 |
+
stores a null pointer value; otherwise, constructs a `weak_ptr` object
|
| 23 |
+
that shares ownership with `r` and stores a copy of the pointer stored
|
| 24 |
+
in `r`.
|
| 25 |
|
| 26 |
*Ensures:* `use_count() == r.use_count()`.
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
weak_ptr(weak_ptr&& r) noexcept;
|
|
|
|
| 32 |
|
| 33 |
*Constraints:* For the second constructor, `Y*` is compatible with `T*`.
|
| 34 |
|
| 35 |
*Effects:* Move constructs a `weak_ptr` instance from `r`.
|
| 36 |
|
| 37 |
+
*Ensures:* `*this` contains the old value of `r`. `r` is empty, stores a
|
| 38 |
+
null pointer value, and `r.use_count() == 0`.
|
| 39 |
|