Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-01-02 13:55:58


In the paragraph "Limitations", where the forwarding
problem is discussed, the following appears:

"...An oft-proposed "solution" to this problem is to add
an overload:

template<class T> void f(T & t);
template<class T> void f(T const & t);

Unfortunately, this (a) requires providing 512 overloads
for nine arguments and (b) does not actually work for
const arguments, both l- and r-values, since the two
templates produce the exact same signature and cannot be
partially ordered."

It's asserion (b) that puzzles me. Doesn't the standard
say that the second overload of f is more specialized
thus yielding a well-defined partial order? This tricky
businesses always elude me, so I might be totally
wrong, of course :)

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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