Title
Partial ordering, references and cv-qualifiers
Status
nad
Section
13.10.3.2 [temp.deduct.call]
Submitter
Mike Miller

Created on 1999-03-05.00:00:00 last changed 294 months ago

Messages

Date: 1999-10-15.00:00:00

Rationale (10/99): The Standard correctly reflects the intent of the Committee.

(October 2002) This is resolved by issue 214.

Date: 2022-02-18.07:47:23

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:00adminsetmessages: + msg293
2000-02-23 00:00:00adminsetstatus: open -> nad
1999-03-05 00:00:00admincreate