Hartmut,

This looks like a slightly more subtle error. I'm deploying threads in this
fashion (line 65):
https://github.com/STEllAR-GROUP/hpx/blob/master/libs/parallelism/threading/tests/unit/thread_launching.cpp

I've a situation where the code I'm working on attempts to store
hpx::thread:id's into a std::unordered_set<hpx::thread::id, std::int32_t>.
The compiler is throwing the following error:

".../c++/x.y.z/bits/hashtable_policy.h:87:34: error: no match for call to
`(const std::hash<hpx::thread::id>) (const hpx::thread::id&)`

The compiler (gnu) is complaining std::hash<> hasn't been specialized on
hpx::thread::id. From my compilation errors, it looks like hpx::threads::id
!= hpx::thread::id.

Lines 241 and 242 (thread_launching.cpp) have some commented out lines that
look like the start of a template specialization on hpx::thread::id.

For reference, line 75 specializes std::hash<> on hpx::threads::id not
hpx::thread:id; this file:
https://github.com/STEllAR-GROUP/hpx/blob/master/libs/core/threading_base/include/hpx/threading_base/threading_base_fwd.hpp

Wasn't sure if ya'll have seen this issue before or not. Thanks for looking
into this one!

v/r,
Chris



On Tue, Jan 26, 2021 at 1:31 PM Hartmut Kaiser <[email protected]> wrote:

> Chris,
>
> > i'm attempting to use std::hash<hpx::thread::id> and found a template
> > specialized version of std::hash<hpx::threads::id> in this file:
> > hpx/threading_base/threading_base_fwd.hpp
> >
> > The implementation makes use of a template specialized version of
> > std::hash<hpx::threads::thread_data const*>.
> >
> > Would recycling that code for hpx::thread::id and
> > hpx::threads::thread_data be sufficient or should I take another
> approach?
>
> std::hash<hpx::threads::id> should just work for you (because of the code
> you
> mentioned). What issues do you have?
>
> Thanks!
> Regards Hartmut
> ---------------
> http://stellar.cct.lsu.edu
> https://github.com/STEllAR-GROUP/hpx
>
>
>
>
>
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to