This is the mail archive of the pthreads-win32@sourceware.org mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using pthread_t as a key in a map


I have a source code that uses the pthread_t as a key in a std::map.
Because pthread-win32 defines pthread_t as a structure, the compilation fails.

I added the following lines in my pthread.h header in order to allow
the usage of pthread_t in the map:

bool operator < (const ptw32_handle_t& left, const ptw32_handle_t& right)
{
   return left.p < right.p;
}

bool operator > (const ptw32_handle_t& left, const ptw32_handle_t& right)
{
   return left.p > right.p;
}

Bye
Paolo Brandoli
http://www.puntoexe.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]