From: spencer@ERA.COM (Spencer Allain)
Subject: Re: Syntax question
Date: Thu, 16 Mar 1995 14:44:30 GMT
Date: 1995-03-16T14:44:30+00:00 [thread overview]
Message-ID: <SPENCER.95Mar16094430@calvin.ERA.COM> (raw)
In-Reply-To: dweller@Starbase.NeoSoft.COM's message of 15 Mar 1995 20: 25:11 -0600
In article <3k87i7$q7g@Starbase.NeoSoft.COM> dweller@Starbase.NeoSoft.COM (David Weller) writes:
In article <3k7t8o$4pt@hacgate2.hac.com>,
David Kusuda <dkusu@atc-1s.hac.com> wrote:
> b) Omit parameters which have default values. I think that this
> is very useful, too bad C++ doesn't have the same thing.
>
It does, too! All you hafta do is add another member function with
the new parameter list. After that, all it is is just another
recompile :-)
Just as a clarification, not as a defense, C++ does allow omission of defaulted
parameters.
The function declared as
void func(int first,
int second = 2,
int third = 3) ;
can be accessed in any of the three following ways.
func(4, 5, 6) ;
func(4, 5) ;
func(4) ;
What you cannot do is something of this nature,
func(4, third:6);
since binding of variables is purely positional, and there is no such thing
as the "third:" syntax shown above.
This is what I assume was referred to when mentioning that C++ was unable
to omit (intermediate) parameters with default values.
Spencer Allain <spencer@era.com>
Engineering Research Associates
Vienna, VA 22182
next prev parent reply other threads:[~1995-03-16 14:44 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-03-11 10:12 Syntax question Geoffrey Hollingworth
1995-03-11 15:16 ` Robert A Duff
1995-03-11 20:45 ` Michael Feldman
1995-03-15 23:29 ` David Kusuda
1995-03-16 2:25 ` David Weller
1995-03-16 14:44 ` Spencer Allain [this message]
1995-03-19 1:04 ` Robert Dewar
1995-03-16 9:19 ` Fred J. McCall
1995-03-17 5:44 ` Niklas Holsti
1995-03-19 20:53 ` Robert Dewar
1995-03-11 21:44 ` Road Pilot
1995-03-23 13:07 ` Bob Collins
1995-03-24 1:11 ` Kevin F. Quinn
1995-03-27 14:19 ` Norman H. Cohen
1995-03-13 4:43 ` Keith Thompson
1995-03-16 20:37 ` Norman H. Cohen
1995-03-21 0:51 ` Robert Dewar
1995-03-16 19:20 ` Adam Beneschan
-- strict thread matches above, loose matches on Subject: below --
2001-07-05 17:58 Syntax Question Robby Simpson
2001-07-05 18:32 ` Marin David Condic
2001-07-05 18:38 ` Robby Simpson
2001-07-05 19:09 ` Ted Dennison
2001-07-05 20:14 ` Robby Simpson
2001-07-05 21:44 ` Robert Dewar
2001-07-09 12:39 ` Robby Simpson
[not found] <Cx6pG3.IEp@ucc.su.oz.au>
1994-10-05 14:20 ` Syntax question Tucker Taft
[not found] ` <36ui0u$4dg@gnat.cs.nyu.edu>
1994-10-06 0:04 ` David Weller
1994-10-05 5:19 Adrian Cho
1994-10-05 11:52 ` Robert Dewar
1994-10-05 17:19 ` Norman H. Cohen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox