Thread View: comp.std.c++
4 messages
4 total messages
Started by Anil Vijendran
Fri, 29 Sep 1995 16:24
overloading and WP
Author: Anil Vijendran
Date: Fri, 29 Sep 1995 16:24
Date: Fri, 29 Sep 1995 16:24
30 lines
1619 bytes
1619 bytes
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. ]
Re: overloading and WP
Author: Andrew Koenig
Date: Sat, 30 Sep 1995 19:09
Date: Sat, 30 Sep 1995 19:09
31 lines
1505 bytes
1505 bytes
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. ]
Re: overloading and WP
Author: Andrew Koenig
Date: Thu, 05 Oct 1995 08:16
Date: Thu, 05 Oct 1995 08:16
23 lines
1181 bytes
1181 bytes
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. ]
Re: overloading and WP
Author: Stefan Glass
Date: Thu, 05 Oct 1995 08:29
Date: Thu, 05 Oct 1995 08:29
36 lines
1869 bytes
1869 bytes
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. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads