From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4886 invoked by alias); 9 May 2006 20:55:49 -0000 Received: (qmail 4878 invoked by uid 22791); 9 May 2006 20:55:48 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0102.google.com (HELO nz-out-0102.google.com) (64.233.162.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 09 May 2006 20:55:46 +0000 Received: by nz-out-0102.google.com with SMTP id z6so573387nzd for ; Tue, 09 May 2006 13:55:44 -0700 (PDT) Received: by 10.65.235.15 with SMTP id m15mr1908353qbr; Tue, 09 May 2006 13:55:44 -0700 (PDT) Received: by 10.64.213.6 with HTTP; Tue, 9 May 2006 13:55:44 -0700 (PDT) Message-ID: <553911630605091355q64a6eec6i76cadef9b9efa0e@mail.gmail.com> Date: Tue, 09 May 2006 20:55:00 -0000 From: "Paolo Brandoli" To: pthreads-win32@sourceware.org Subject: Using pthread_t as a key in a map MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2006/txt/msg00014.txt.bz2 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 fai= ls. 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