tmp/tmp6jvjm9ot/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Struct `owner_hash` <a id="util.smartptr.owner.hash">[[util.smartptr.owner.hash]]</a>
|
| 2 |
+
|
| 3 |
+
The class `owner_hash` provides ownership-based hashing.
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
namespace std {
|
| 7 |
+
struct owner_hash {
|
| 8 |
+
template<class T>
|
| 9 |
+
size_t operator()(const shared_ptr<T>&) const noexcept;
|
| 10 |
+
|
| 11 |
+
template<class T>
|
| 12 |
+
size_t operator()(const weak_ptr<T>&) const noexcept;
|
| 13 |
+
|
| 14 |
+
using is_transparent = unspecified;
|
| 15 |
+
};
|
| 16 |
+
}
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
``` cpp
|
| 20 |
+
template<class T>
|
| 21 |
+
size_t operator()(const shared_ptr<T>& x) const noexcept;
|
| 22 |
+
template<class T>
|
| 23 |
+
size_t operator()(const weak_ptr<T>& x) const noexcept;
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
*Returns:* `x.owner_hash()`.
|
| 27 |
+
|
| 28 |
+
[*Note 1*: For any object `y` where `x.owner_equal(y)` is `true`,
|
| 29 |
+
`x.owner_hash() == y.owner_hash()` is `true`. — *end note*]
|
| 30 |
+
|