Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2002 23:30:47 -0700
From:      Chad David <davidc@acns.ab.ca>
To:        questions@freebsd.org
Subject:   C++ Question
Message-ID:  <20020404233047.A8398@colnta.acns.ab.ca>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020404233047.A8398>