Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-02-18 13:19:12


On Mon, 18 Feb 2002, Beman Dawes wrote:
bdawes> >As posted earlier, there's a difficulty in trying to shoehorn named
bdawes> >parameters into the current framework, because parameters names currently
bdawes> >don't mean anything, only position does. Take for example:
bdawes> >
bdawes> >template <typename A = char, typename B = int> class foo;
bdawes> >...
bdawes> >template <typename B = char, typename A = int> class foo;
bdawes> >
bdawes> >foo<B=int> // what does this mean?
bdawes>
bdawes> Can't you just say "first seen?" as the answer to the question?
bdawes>
bdawes> An implementation might also (as QOI) warn if additional declarations
bdawes> rename or reorder the parameters.

That is certainly an option. The disadvantages I see are 1) it is fragile:
a change in the order of the declarations would change the meaning of the
program (when normally that isn't the case), and 2) compilers would start
emitting warnings about code that currently is perfectly good C++.

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk