This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
[Moved to DR at the November, 2014 meeting.]
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.
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 otherthe 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.
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 otherthe 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.