Template Default Arguments

Template Default Arguments - Template Default Arguments...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Template Default Arguments Jonathan Schilling, jls@sco.com If you look at the currently available "second Committee Draft" of the proposed standard (see C++ Newsletter #020), you'll find some very curious wording in Clause 17.3.4.4: Throughout the C++ Library clauses (17 through 27), whenever a template member function is declared with one or more default arguments, this is to be understood as specifying a set of two or more overloaded template member functions. The version with the most parameters defines the interface; the versions with fewer parameters are to be understood as functions with fewer parameters, in which the corresponding default argument is substituted in-place. This "standards rewrite rule" is an example of the last-minute standards patching that goes on when both a language and a library are being aggressively designed at the same time, and then somebody discovers that the library depends upon a language feature that doesn't exist. Here's the problem: class A { public:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Template Default Arguments - Template Default Arguments...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online