public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* Using pthread_t as a key in a map
@ 2006-05-09 20:55 Paolo Brandoli
  2006-05-15  2:23 ` Will Bryant
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Brandoli @ 2006-05-09 20:55 UTC (permalink / raw)
  To: pthreads-win32

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-16 14:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-09 20:55 Using pthread_t as a key in a map Paolo Brandoli
2006-05-15  2:23 ` Will Bryant
2006-05-15 11:57   ` Paolo Brandoli
2006-05-15 14:02     ` Robert Kindred
2006-05-15 14:24   ` Ross Johnson
2006-05-16  1:17     ` Ross Johnson
2006-05-16 14:09       ` Paolo Brandoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).