From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18527 invoked by alias); 4 Apr 2003 12:32:45 -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 18518 invoked from network); 4 Apr 2003 12:32:45 -0000 Received: from unknown (HELO smtp-relay-1.adobe.com) (192.150.11.1) by sources.redhat.com with SMTP; 4 Apr 2003 12:32:45 -0000 Received: from inner-relay-2.corp.adobe.com (inner-relay-2 [153.32.1.52]) by smtp-relay-1.adobe.com (8.12.8/8.12.8) with ESMTP id h34CWgqS026646 for ; Fri, 4 Apr 2003 04:32:43 -0800 (PST) Received: from iplan-mn.corp.adobe.com (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-2.corp.adobe.com (8.12.3/8.12.3) with ESMTP id h34CWagm003112 for ; Fri, 4 Apr 2003 04:32:37 -0800 (PST) Received: from [130.248.25.184] ([153.32.12.150]) by iplan-mn.corp.adobe.com (Netscape Messaging Server 4.15 mn Jul 11 2001 16:32:57) with ESMTP id HCTK6B00.3OM; Fri, 4 Apr 2003 06:32:35 -0600 User-Agent: Microsoft-Entourage/10.0.0.1331 Date: Fri, 04 Apr 2003 12:32:00 -0000 Subject: Re: Const in default function arguments? From: John Love-Jensen To: Eric Lemings , Message-ID: In-Reply-To: <000b01c2fa2d$d73bad80$0300a8c0@lemings.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SW-Source: 2003-04/txt/msg00027.txt.bz2 Hi Eric, >Why won't the non-const version compile? Because by making it a non-const reference, you are saying that you are going to modify it. That is to say, you are making an "OUT" or "UPDATE" (in/out) parameter. When you specify a default object, you are making a temporary. It doesn't make sense to modify a temporary. --Eljay