Title
Partial ordering and explicit arguments
Status
dup
Section
13.7.7.3 [temp.func.order]
Submitter
Martin Sebor

Created on 2000-01-28.00:00:00 last changed 290 months ago

Messages

Date: 2000-04-15.00:00:00

Rationale (04/00):

This issue is covered in a more general context in issue 214.

Date: 2022-11-20.07:54:16

The description of how the partial ordering of template functions is determined in 13.7.7.3 [temp.func.order] paragraphs 3-5 does not make any provision for nondeduced template parameters. For example, the function call in the following code is ambiguous, even though one template is "obviously" more specialized than the other:

    template <class T> T f(int);
    template <class T, class U> T f(U);
    void g() {
        f<int>(1);
    }
The reason is that neither function parameter list allows template parameter T to be deduced; both deductions fail, so neither template is considered more specialized than the other and the function call is ambiguous.

One possibility of addressing this situation would be to incorporate explicit template arguments from the call in the argument deduction using the transformed function parameter lists. In this case, that would result in finding the first template to be more specialized than the second.

History
Date User Action Args
2000-05-21 00:00:00adminsetmessages: + msg376
2000-05-21 00:00:00adminsetstatus: open -> dup
2000-01-28 00:00:00admincreate