develooper Front page | perl.perl6.language | Postings from April 2002

Re: Defaulting params

Thread Previous | Thread Next
From:
Aaron Sherman
Date:
April 11, 2002 09:46
Subject:
Re: Defaulting params
Message ID:
1018543562.19990.182.camel@pps
On Thu, 2002-04-11 at 12:44, Luke Palmer wrote:
> > 	class myobj {
> > 		...
> > 		int a,b,c;
> > 		myobj(int aa, int bb, int cc) :
> > 			a(aa), b(bb), c(cc) const {}
> > 		...
> > 	};
> 
> Ummm no. Straight from Bjarne: "You can't have a const constructor." You 
> just do what you did without the const. A const myobj is essentially 
> equivalent (with the exception of not being allowed to call methods not 
> marked 'const', except the constructor) to:

I'm not much of a C++ fan, as you can tell. What he said, but my point
stands in a somewhat modified capacity....

Do we have a way to do this, or do we not do it, or do we adopt a silly
C++-like style?



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About