2.0 KiB
[util.smartptr.owner.equal]
20 Memory management library [mem]
20.3 Smart pointers [smartptr]
20.3.2 Shared-ownership pointers [util.sharedptr]
20.3.2.6 Struct owner_equal [util.smartptr.owner.equal]
The class owner_equal provides ownership-based mixed equality comparisons of shared and weak pointers.
namespace std {struct owner_equal {template<class T, class U>constexpr bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; template<class T, class U>constexpr bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; template<class T, class U>constexpr bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; template<class T, class U>constexpr bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; using is_transparent = unspecified; };}
template<class T, class U> constexpr bool operator()(const shared_ptr<T>& x, const shared_ptr<U>& y) const noexcept; template<class T, class U> constexpr bool operator()(const shared_ptr<T>& x, const weak_ptr<U>& y) const noexcept; template<class T, class U> constexpr bool operator()(const weak_ptr<T>& x, const shared_ptr<U>& y) const noexcept; template<class T, class U> constexpr bool operator()(const weak_ptr<T>& x, const weak_ptr<U>& y) const noexcept;
Returns: x.owner_equal(y).
[Note 1:
x.owner_equal(y) is true if and only if x and y share ownership or are both empty.
â end note]