Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-01-03 07:46:44

> 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?

It does now, although I'm not sure whether it is the second overload that
wins. :-) The original partial ordering rule wasn't clear.

Boost list run by bdawes at, gregod at, cpdaniel at, john at