From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29758 invoked by alias); 26 Aug 2004 17:27:56 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29507 invoked from network); 26 Aug 2004 17:27:39 -0000 Received: from unknown (HELO hotmail.com) (65.54.245.23) by sourceware.org with SMTP; 26 Aug 2004 17:27:39 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 26 Aug 2004 10:27:36 -0700 Received: from 219.65.103.140 by by1fd.bay1.hotmail.msn.com with HTTP; Thu, 26 Aug 2004 17:27:36 GMT X-Originating-IP: [219.65.103.140] X-Originating-Email: [suresh_lakshmana@hotmail.com] X-Sender: suresh_lakshmana@hotmail.com From: "Suresh Lakshmanan" To: gcc-help@gcc.gnu.org Cc: vonloesch@gmail.com Bcc: Subject: RE: Problem with implicit conversion (GCC 3.4.1) Date: Thu, 26 Aug 2004 19:54:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 26 Aug 2004 17:27:36.0409 (UTC) FILETIME=[FA995C90:01C48B91] X-SW-Source: 2004-08/txt/msg00242.txt.bz2 Try the code below. You could use std::min template in STL, so that you can force conversion to the template parameter. template class BasisF { T x; public: BasisF(const T &_x = T()): x(_x) {} BasisF(const BasisF &_b): x(_b.x) {} ~BasisF() {} BasisF& operator= (const T &_x){ x(_x); return *this; } friend bool operator<=(const BasisF &a, const BasisF &b) { return a.x <= b.x; } }; #define min(a,b) ((a) <= (b) ? (a) : (b)) int main(){ BasisF t(1); if (min(t, 2.0)<= 0) { return 1; } return 0; } Thanks, L.Suresh. _________________________________________________________________ Sell what you don’t Need.We help you Ship it out. http://go.msnserver.com/IN/54179.asp Click Here!