This is the mail archive of the
pthreads-win32@sourceware.org
mailing list for the pthreas-win32 project.
Using pthread_t as a key in a map
- From: "Paolo Brandoli" <paolo dot brandoli at gmail dot com>
- To: pthreads-win32 at sourceware dot org
- Date: Tue, 9 May 2006 22:55:44 +0200
- Subject: 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