I would like to store a class of my own in a map, with the key being of type pthread_t.(Each object of my class contains a pthread_t data member so I want each instance to be associated with that pthread_t as a key, in a map) The problem is pthread_t can't be compared, only with pthread_equal so I can't put it in a map as a key.
I have seen unordered_map, but how can I implement a hash function for pthread_t?
Until now I thought about comparing them using pthread_self(), but that's also impossible since the returned value is pthread_t, and I don't want to use the fact that this is just a typedef for unsigned long int.
If using some sort of map is not possible, how can I store pthread_t's objects in a container and find them fast using pthread_self() funcion?