From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14563 invoked by alias); 5 Mar 2003 04:59:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14549 invoked from network); 5 Mar 2003 04:59:42 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.129.200.2) by 172.16.49.205 with SMTP; 5 Mar 2003 04:59:42 -0000 Received: from lincoln.constant.com (tooth.toronto.redhat.com [172.16.14.29]) by touchme.toronto.redhat.com (Postfix) with SMTP id 1D37480001E; Tue, 4 Mar 2003 23:59:41 -0500 (EST) Date: Wed, 05 Mar 2003 04:59:00 -0000 From: Benjamin Kosnik To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: operands to min and max must have the same type... Message-Id: <20030304225734.57d1be09.bkoz@redhat.com> In-Reply-To: References: <20030304161138.51f78591.bkoz@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00408.txt.bz2 >> ptrdiff_t new_size = std::max(static_cast(2 * old_size), ptrdiff_t (1)); > >Err... I don't understand. Why must one of them be a static_cast >while the other is ok as a functional cast? Are conventions like this >documented anywhere? Sorry, in my haste I didn't notice the second. I suppose you could just do ptrdiff_t(1 * old_size), ptrdiff_t(1) (note the lack of space). See C++STYLE. -benjamin