Title
Unclear specification of “more specialized”
Status
cd4
Section
13.10.3.5 [temp.deduct.partial]
Submitter
Johannes Schaub

Created on 2013-06-26.00:00:00 last changed 95 months ago

Messages

Date: 2014-11-15.00:00:00

[Moved to DR at the November, 2014 meeting.]

Date: 2014-02-15.00:00:00

Proposed resolution (February, 2014):

Change 13.10.3.5 [temp.deduct.partial] paragraphs 9-10 as follows:

If, for a given type, deduction succeeds in both directions (i.e., the types are identical after the transformations above) and both P and A were reference types (before being replaced with the type referred to above):

  • if the type from the argument template was an lvalue reference and the type from the parameter template was not, the argument type is considered to be more specialized than the other the parameter type is not considered to be at least as specialized as the argument type; otherwise,

  • if the type from the argument template is more cv-qualified than the type from the parameter template (as described above), the argument type is considered to be more specialized than the other; otherwise, the parameter type is not considered to be at least as specialized as the argument type.

  • neither type is more specialized than the other.

If for each type being considered a given template is at least as specialized for all types and more specialized for some set of types and the other template is not more specialized for any types or is not at least as specialized for any types, then the given template is more specialized than the other template. Otherwise, neither template is more specialized than the other. Function template F is at least as specialized as function template G if, for each pair of types used to determine the ordering, the type from F is at least as specialized as the type from G. F is more specialized than G if F is at least as specialized as G and G is not at least as specialized as F.

Date: 2013-09-15.00:00:00

Proposed resolution (September, 2013) [SUPERSEDED]:

Change 13.10.3.5 [temp.deduct.partial] paragraphs 9 and 10 as follows:

If, for a given type, deduction succeeds in both directions (i.e., the types are identical after the transformations above) and both P and A were reference types (before being replaced with the type referred to above):

  • if the type from the argument template was an lvalue reference and the type from the parameter template was not, the argument type is considered to be more specialized than the other the other type is not considered to be at least as specialized as the argument type; otherwise,

  • if the type from the argument template is more cv-qualified than the type from the parameter template (as described above), the argument type is considered to be more specialized than the other; otherwise, the other type is not considered to be at least as specialized as the argument type.

  • neither type is more specialized than the other.

If for each type being considered a given template is at least as specialized for all types and more specialized for some set of types and the other template is not more specialized for any types or is not at least as specialized for any types, then the given template is more specialized than the other template. Otherwise, neither template is more specialized than the other. A given template is at least as specialized as another template if it is at least as specialized as the other template for all types being considered. A given template is more specialized than another template if it is at least as specialized as the other template for all types being considered, and the other template is not at least as specialized as the given template for any type being considered.

Date: 2013-06-26.00:00:00

The current wording of 13.10.3.5 [temp.deduct.partial] paragraph 10 is:

If for each type being considered a given template is at least as specialized for all types and more specialized for some set of types and the other template is not more specialized for any types or is not at least as specialized for any types, then the given template is more specialized than the other template. Otherwise, neither template is more specialized than the other.

This is confusing and needs to be clarified.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-05-25 00:00:00adminsetstatus: dr -> drwp
2015-04-13 00:00:00adminsetmessages: + msg5419
2014-11-24 00:00:00adminsetstatus: ready -> dr
2014-03-03 00:00:00adminsetmessages: + msg4857
2014-03-03 00:00:00adminsetstatus: review -> ready
2013-10-14 00:00:00adminsetmessages: + msg4613
2013-10-14 00:00:00adminsetstatus: open -> review
2013-06-26 00:00:00admincreate