Topic: Default parameters- are these post CD2 changes?


Author: bparker@mailbox.uq.edu.au (Brian Parker)
Date: 1997/10/31
Raw View
I've recently been reading "The C++ Programming Language 3rd edition"
(excellent book, BTW) and it mentions some details that differ from
the CD2. Could someone in the know please confirm that the following
details are indeed post-CD2 changes.

(1) 14.1 [temp.param]/8 bans default template arguments in template
functions, but CPP PL describes them on p 340.
(actually, I never knew why they were banned in the CD2)

(2) 8.3.6 [dcl.fct.default] specifies that (non-template) function
default arguments may not be redefined in a later declaration, not
even to the same value. However CPP PL, p153 says that default
argument values can be repeated if they have the same value.

I much prefer this new rule- it will allow one to cut and paste code
directly from headers to the function definitions without having to
remove the default parameters, and in any case the old rules differed
completely from those for template default arguments.

Thanks,
Brian Parker

---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]