Topic: overloading and WP
Author: Stefan Glass <glasss@boat.bt.com>
Date: 1995/10/04 Raw View
In article <AKV.95Sep29014218@srl03.cacs.usl.edu> akv@cacs.usl.edu writes:
>> Check out the third declaration of function "f". Is that supposed to
>> be an error -- I mean the comment?
>>
>> 13.1 Overloadable declarations [over.load]
>> ....
>> --Two parameter declarations that differ only in their default argu-
>> ments are equivalent. [Example: consider the following:
>> void f (int i, int j);
>> void f (int i, int j = 99); // Ok: redeclaration of f (int, int)
>> void f (int i = 88); // Ok: redeclaration of f (int, int)
>> void f (); // Ok: overloaded declaration of f
And Andrew Koenig (ark@att.research.com) replied:
> It's a typo: the line
>
> void f (int i = 88);
>
> should read
>
> void f (int i = 88, j);
There's a typo in the correction. j isn't declared as an int, or as anything
for that matter. ( Or does this mean we're reintroducing the K&R C rule that
unspecified identifiers are ints %^)
Steve Glass
Canolfan Peirianneg Meddalwedd Caerdydd
BT
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Author: Stefan Glass <glasss@boat.bt.com>
Date: 1995/10/05 Raw View
In article <AKV.95Sep29014218@srl03.cacs.usl.edu> akv@cacs.usl.edu writes:
>> Check out the third declaration of function "f". Is that supposed to
>> be an error -- I mean the comment?
>>
>> 13.1 Overloadable declarations [over.load]
>> ....
>> --Two parameter declarations that differ only in their default argu-
>> ments are equivalent. [Example: consider the following:
>> void f (int i, int j);
>> void f (int i, int j = 99); // Ok: redeclaration of f (int, int)
>> void f (int i = 88); // Ok: redeclaration of f (int, int)
>> void f (); // Ok: overloaded declaration of f
And Andrew Koenig (ark@att.research.com) replied:
> It's a typo: the line
>
> void f (int i = 88);
>
> should read
>
> void f (int i = 88, j);
There's a typo in the correction. j isn't declared as an int, or as anything
for that matter. ( Or does this mean we're reintroducing the K&R C rule that
unspecified identifiers are ints %^)
Steve Glass
Canolfan Peirianneg Meddalwedd Caerdydd
BT
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Author: ark@research.att.com (Andrew Koenig)
Date: 1995/10/05 Raw View
In article <199510040919.DAA18472@ncar.ucar.EDU> Stefan Glass <glasss@boat.bt.com> writes:
> > void f (int i = 88, j);
> There's a typo in the correction. j isn't declared as an int, or as anything
> for that matter. ( Or does this mean we're reintroducing the K&R C rule that
> unspecified identifiers are ints %^)
Sigh. I meant
void f(int i = 88, int j);
and that is what the draft actually says.
--
--Andrew Koenig
ark@research.att.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Author: akv@cacs.usl.edu
Date: 1995/09/29 Raw View
Question:
The following is an excerpt (sp?) from WP @ Cygnus.COM
(http://www.cygnus.com/~mrs/wp-draft.
Check out the third declaration of function "f". Is that supposed to
be a typo or an error that has been rectified -- I mean the comment?
Thanks.
13.1 Overloadable declarations [over.load]
....
--Two parameter declarations that differ only in their default argu-
ments are equivalent. [Example: consider the following:
void f (int i, int j);
void f (int i, int j = 99); // Ok: redeclaration of f (int, int)
void f (int i = 88); // Ok: redeclaration of f (int, int)
void f (); // Ok: overloaded declaration of f
--
Peace.... +<:-)
Anil
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Author: akv@srl03.cacs.usl.edu (Anil Vijendran)
Date: 1995/09/29 Raw View
Question:
The following is an excerpt (sp?) from WP @ Cygnus.COM
(http://www.cygnus.com/~mrs/wp-draft.
Check out the third declaration of function "f". Is that supposed to
be an error -- I mean the comment?
13.1 Overloadable declarations [over.load]
....
--Two parameter declarations that differ only in their default argu-
ments are equivalent. [Example: consider the following:
void f (int i, int j);
void f (int i, int j = 99); // Ok: redeclaration of f (int, int)
void f (int i = 88); // Ok: redeclaration of f (int, int)
void f (); // Ok: overloaded declaration of f
--
Anil
___________________________________________________________________________
Anil K Vijendran USL Box 43007, Lafayette, LA 70504-3007
akv@cacs.usl.edu (318) 232-5502 [H]
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Author: ark@research.att.com (Andrew Koenig)
Date: 1995/09/30 Raw View
In article <AKV.95Sep29014218@srl03.cacs.usl.edu> akv@cacs.usl.edu writes:
> Check out the third declaration of function "f". Is that supposed to
> be an error -- I mean the comment?
> 13.1 Overloadable declarations [over.load]
> ....
> --Two parameter declarations that differ only in their default argu-
> ments are equivalent. [Example: consider the following:
> void f (int i, int j);
> void f (int i, int j = 99); // Ok: redeclaration of f (int, int)
> void f (int i = 88); // Ok: redeclaration of f (int, int)
> void f (); // Ok: overloaded declaration of f
It's a typo: the line
void f (int i = 88);
should read
void f (int i = 88, j);
--
--Andrew Koenig
ark@research.att.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]