From owner-freebsd-questions Thu Apr 4 22:39:57 2002 Delivered-To: freebsd-questions@freebsd.org Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by hub.freebsd.org (Postfix) with ESMTP id A5AA537B419 for ; Thu, 4 Apr 2002 22:39:51 -0800 (PST) Received: from k7.mavetju.org (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id 350772B696; Fri, 5 Apr 2002 08:39:49 +0200 (CEST) Received: by k7.mavetju.org (Postfix, from userid 1001) id 356CC1CD; Fri, 5 Apr 2002 16:39:51 +1000 (EST) Date: Fri, 5 Apr 2002 16:39:51 +1000 From: Edwin Groothuis To: Chad David Cc: questions@freebsd.org Subject: Re: C++ Question Message-ID: <20020405163951.E56548@k7.mavetju.org> References: <20020404233047.A8398@colnta.acns.ab.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020404233047.A8398@colnta.acns.ab.ca>; from davidc@acns.ab.ca on Thu, Apr 04, 2002 at 11:30:47PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Apr 04, 2002 at 11:30:47PM -0700, Chad David wrote: > I realize this isn't really a FreeBSD question, but... > > I'm porting a bunch of code to FreeBSD and I've run into the following: > > int do_xyz(String &s1, String &s2 = String(), String &s3 = String()); > > g++ complains fails with the following: > > file.h:100: invalid type `String' for default argument to `String &' Not bothered by any knowledge, but what if you remove the assignments from the prototyping? int do_xyz(String &s1, String &s2, String &s3); And then let the function definition the same (i.e. with the assignments). Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: ------------------+ http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message