This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


99. Partial ordering, references and cv-qualifiers

Section:  []     Status: NAD     Submitter: Mike Miller     Date: 5 Mar 1999


    template <class T> void f(T&);
    template <class T> void f(const T&);
    void m() {
        const int p = 0;
Some compilers treat this as ambiguous; others prefer f(const T&). The question turns out to revolve around whether [] 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.