Created on 1999-03-05.00:00:00 last changed 301 months ago
Rationale (10/99): The Standard correctly reflects the intent of the Committee.
(October 2002) This is resolved by issue 214.
Consider:
template <class T> void f(T&); template <class T> void f(const T&); void m() { const int p = 0; f(p); }Some compilers treat this as ambiguous; others prefer f(const T&). The question turns out to revolve around whether 13.10.3.2 [temp.deduct.call] paragraph 2 says what it ought to regarding the removal of cv-qualifiers and reference modifiers from template function parameters in doing type deduction.
John Spicer: The partial ordering rules as originally proposed specified that, for purposes of comparing parameter types, you remove a top level reference, and after having done that you remove top level qualifiers. This is not what is actually in the IS however. The IS says that you remove top level qualifiers and then top level references.
The original rules were intended to prefer f(A<T>) over f(const T&).
Rationale (10/99): The Standard correctly reflects the intent of the Committee.
(October 2002) This is resolved by issue 214.
History | |||
---|---|---|---|
Date | User | Action | Args |
2000-02-23 00:00:00 | admin | set | messages: + msg293 |
2000-02-23 00:00:00 | admin | set | status: open -> nad |
1999-03-05 00:00:00 | admin | create |