diff --git a/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp b/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp index 22489bba118a..e69a9e77ec54 100644 --- a/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp +++ b/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/libs/parallelism/threading/include/hpx/threading/thread.hpp b/libs/parallelism/threading/include/hpx/threading/thread.hpp index 8fa11ee6cdaf..ac8f6cdb6926 100644 --- a/libs/parallelism/threading/include/hpx/threading/thread.hpp +++ b/libs/parallelism/threading/include/hpx/threading/thread.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -310,4 +311,18 @@ namespace hpx { } // namespace this_thread } // namespace hpx +namespace std { + + // specialize std::hash for hpx::thread::id + template <> + struct hash<::hpx::thread::id> + { + std::size_t operator()(::hpx::thread::id const& id) const + { + std::hash<::hpx::threads::thread_id_type> hasher_; + return hasher_(id.native_handle()); + } + }; +} // namespace std + #include