From Jason Turner

[util.smartptr.owner.equal]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpo7ixyalo/{from.md → to.md} +38 -0
tmp/tmpo7ixyalo/{from.md → to.md} RENAMED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Struct `owner_equal` <a id="util.smartptr.owner.equal">[[util.smartptr.owner.equal]]</a>
2
+
3
+ The class `owner_equal` provides ownership-based mixed equality
4
+ comparisons of shared and weak pointers.
5
+
6
+ ``` cpp
7
+ namespace std {
8
+ struct owner_equal {
9
+ template<class T, class U>
10
+ constexpr bool operator()(const shared_ptr<T>&, const shared_ptr<U>&) const noexcept;
11
+ template<class T, class U>
12
+ constexpr bool operator()(const shared_ptr<T>&, const weak_ptr<U>&) const noexcept;
13
+ template<class T, class U>
14
+ constexpr bool operator()(const weak_ptr<T>&, const shared_ptr<U>&) const noexcept;
15
+ template<class T, class U>
16
+ constexpr bool operator()(const weak_ptr<T>&, const weak_ptr<U>&) const noexcept;
17
+
18
+ using is_transparent = unspecified;
19
+ };
20
+ }
21
+ ```
22
+
23
+ ``` cpp
24
+ template<class T, class U>
25
+ constexpr bool operator()(const shared_ptr<T>& x, const shared_ptr<U>& y) const noexcept;
26
+ template<class T, class U>
27
+ constexpr bool operator()(const shared_ptr<T>& x, const weak_ptr<U>& y) const noexcept;
28
+ template<class T, class U>
29
+ constexpr bool operator()(const weak_ptr<T>& x, const shared_ptr<U>& y) const noexcept;
30
+ template<class T, class U>
31
+ constexpr bool operator()(const weak_ptr<T>& x, const weak_ptr<U>& y) const noexcept;
32
+ ```
33
+
34
+ *Returns:* `x.owner_equal(y)`.
35
+
36
+ [*Note 1*: `x.owner_equal(y)` is `true` if and only if `x` and `y`
37
+ share ownership or are both empty. — *end note*]
38
+