[libcxx-commits] [libcxx] [libc++] Implement P1901R2: owner_hash and owner_equal for shared_ptr/weak_ptr (PR #210551)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 26 00:27:21 PDT 2026


================
@@ -817,6 +823,31 @@ struct owner_less<void>
     typedef void is_transparent;
 };
 
+// class owner_hash:                                                          // C++26
+struct owner_hash {
+  template<class T>
+    size_t operator()(const shared_ptr<T>&) const noexcept;
+
+  template<class T>
+    size_t operator()(const weak_ptr<T>&) const noexcept;
+
+  using is_transparent = unspecified;
+};
+
+// class owner_equal:                                                         // C++26
+struct owner_equal {
----------------
frederick-vs-ja wrote:

```suggestion
// struct owner_equal
struct owner_equal {                                                           // C++26
```

https://github.com/llvm/llvm-project/pull/210551


More information about the libcxx-commits mailing list