Title
Some questions regarding partial ordering of function templates
Status
nad
Section
13.7.7.3 [temp.func.order]
Submitter
unknown

Created on 1998-10-24.00:00:00 last changed 17 months ago

Messages

Date: 2011-08-15.00:00:00

Rationale (August, 2011):

As given in the preceding note.

Date: 2011-04-15.00:00:00

Additional note (April, 2011):

These points appear to have been addressed by previous resolutions, so presumably the issue is now NAD.

Date: 2022-11-20.07:54:16

Rationale:

This is not a defect; the standard unambiguously makes the above example ill-formed due to ambiguity.

Date: 2022-11-20.07:54:16

Rationale:

This is not a defect; it is not necessary to pinpoint cross-references to this level of detail.

Issue 2:

13.7.7.3 [temp.func.order] paragraph 4 says:

Using the transformed function parameter list, perform argument deduction against the other function template. The transformed template is at least as specialized as the other if, and only if, the deduction succeeds and the deduced parameter types are an exact match (so the deduction does not rely on implicit conversions).
In "the deduced parameter types are an exact match", the terms exact match do not make it clear what happens when a type T is compared to the reference type T&. Is that an exact match?

Issue 3:

13.7.7.3 [temp.func.order] paragraph 5 says:

A template is more specialized than another if, and only if, it is at least as specialized as the other template and that template is not at least as specialized as the first.
What happens in this case:
    template<class T> void f(T,int);
    template<class T> void f(T, T);
    void f(1,1);
For the first function template, there is no type deduction for the second parameter. So the rules in this clause seem to imply that the second function template will be chosen.
Date: 2022-11-20.07:54:16

Issue 1:

13.7.7.3 [temp.func.order] paragraph 2 says:

Given two overloaded function templates, whether one is more specialized than another can be determined by transforming each template in turn and using argument deduction (13.10.3 [temp.deduct] ) to compare it to the other.
13.10.3 [temp.deduct] now has 4 subsections describing argument deduction in different situations. I think this paragraph should point to a subsection of 13.10.3 [temp.deduct] .

History
Date User Action Args
2022-11-20 07:54:16adminsetmessages: + msg7038
2022-11-20 07:54:16adminsetmessages: + msg7037
2011-09-06 00:00:00adminsetmessages: + msg3585
2011-09-06 00:00:00adminsetstatus: review -> nad
2011-04-10 00:00:00adminsetmessages: + msg3270
2011-04-10 00:00:00adminsetstatus: open -> review
1998-10-24 00:00:00admincreate