From owner-freebsd-questions Thu Apr 4 22:31: 4 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mail.acns.ab.ca (mail.acns.ab.ca [142.179.151.95]) by hub.freebsd.org (Postfix) with ESMTP id 5009F37B41A for ; Thu, 4 Apr 2002 22:31:00 -0800 (PST) Received: from colnta.acns.ab.ca (colnta.acns.ab.ca [192.168.1.2]) by mail.acns.ab.ca (8.11.6/8.11.3) with ESMTP id g356Usi45870 for ; Thu, 4 Apr 2002 23:30:54 -0700 (MST) (envelope-from davidc@colnta.acns.ab.ca) Received: from colnta.acns.ab.ca (localhost [127.0.0.1]) by colnta.acns.ab.ca (8.12.2/8.11.3) with ESMTP id g356Ulsn008508 for ; Thu, 4 Apr 2002 23:30:47 -0700 (MST) (envelope-from davidc@colnta.acns.ab.ca) Received: (from davidc@localhost) by colnta.acns.ab.ca (8.12.2/8.12.2/Submit) id g356UlA1008507 for questions@freebsd.org; Thu, 4 Apr 2002 23:30:47 -0700 (MST) Date: Thu, 4 Apr 2002 23:30:47 -0700 From: Chad David To: questions@freebsd.org Subject: C++ Question Message-ID: <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 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 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 &' while the Sun compiler likes it just fine. Not being much of a c++ programmer I'm at a loss. Is there a way to tell g++ that I don't want the String I want a reference? Thanks -- Chad David davidc@acns.ab.ca www.FreeBSD.org davidc@freebsd.org ACNS Inc. Calgary, Alberta Canada Fourthly, The constant breeders, beside the gain of eight shillings sterling per annum by the sale of their children, will be rid of the charge of maintaining them after the first year. - Johnathan Swift To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message