tmp/tmpn6hfvn9c/{from.md → to.md}
RENAMED
|
@@ -2,33 +2,29 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
long use_count() const noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
-
*Returns:* `0` if `*this` is
|
| 8 |
-
`shared_ptr` instances that
|
| 9 |
-
|
| 10 |
-
`use_count()` is not necessarily efficient.
|
| 11 |
|
| 12 |
``` cpp
|
| 13 |
bool expired() const noexcept;
|
| 14 |
```
|
| 15 |
|
| 16 |
*Returns:* `use_count() == 0`.
|
| 17 |
|
| 18 |
-
`expired()` may be faster than `use_count()`.
|
| 19 |
-
|
| 20 |
``` cpp
|
| 21 |
shared_ptr<T> lock() const noexcept;
|
| 22 |
```
|
| 23 |
|
| 24 |
-
*Returns:* `expired() ?
|
| 25 |
executed atomically.
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
-
template<class U> bool owner_before(shared_ptr<U>
|
| 29 |
-
template<class U> bool owner_before(weak_ptr<U>
|
| 30 |
```
|
| 31 |
|
| 32 |
*Returns:* An unspecified value such that
|
| 33 |
|
| 34 |
- `x.owner_before(y)` defines a strict weak ordering as defined
|
|
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
long use_count() const noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
+
*Returns:* `0` if `*this` is empty; otherwise, the number of
|
| 8 |
+
`shared_ptr` instances that share ownership with `*this`.
|
|
|
|
|
|
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
bool expired() const noexcept;
|
| 12 |
```
|
| 13 |
|
| 14 |
*Returns:* `use_count() == 0`.
|
| 15 |
|
|
|
|
|
|
|
| 16 |
``` cpp
|
| 17 |
shared_ptr<T> lock() const noexcept;
|
| 18 |
```
|
| 19 |
|
| 20 |
+
*Returns:* `expired() ? shared_ptr<T>() : shared_ptr<T>(*this)`,
|
| 21 |
executed atomically.
|
| 22 |
|
| 23 |
``` cpp
|
| 24 |
+
template<class U> bool owner_before(const shared_ptr<U>& b) const;
|
| 25 |
+
template<class U> bool owner_before(const weak_ptr<U>& b) const;
|
| 26 |
```
|
| 27 |
|
| 28 |
*Returns:* An unspecified value such that
|
| 29 |
|
| 30 |
- `x.owner_before(y)` defines a strict weak ordering as defined
|