
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

"JOAQUIN LOPEZ MU?Z" wrote:
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.
participants (2)
-
"JOAQUIN LOPEZ MU?Z"
-
Peter Dimov