[libcxx-commits] [libcxx] [libc++] Consolidate ordering/hashing/formatting of std::thread::id. (PR #195763)

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 5 00:22:09 PDT 2026


================
@@ -123,7 +123,7 @@ void __thread_specific_ptr<_Tp>::set_pointer(pointer __p) {
 template <>
 struct hash<__thread_id> : public __unary_function<__thread_id, size_t> {
   _LIBCPP_HIDE_FROM_ABI size_t operator()(__thread_id __v) const _NOEXCEPT {
-    return hash<__libcpp_thread_id>()(__v.__id_);
+    return hash<__thread_id::_HashTp>()(__v.__hash_value());
----------------
petrhosek wrote:

This could be covered by a new API, e.g. `__libcpp_thread_id_hash`.

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


More information about the libcxx-commits mailing list