13 Templates [temp]

13.10 Function template specializations [temp.fct.spec]

13.10.3 Template argument deduction [temp.deduct]

13.10.3.4 Deducing conversion function template arguments [temp.deduct.conv]

Template argument deduction is done by comparing the return type of the conversion function template (call it P) with the type that is required as the result of the conversion (call it A; see [dcl.init], [over.match.conv], and [over.match.ref] for the determination of that type) as described in [temp.deduct.type].
If P is a reference type, the type referred to by P is used in place of P for type deduction and for any further references to or transformations of P in the remainder of this subclause.
If A is not a reference type:
If A is a cv-qualified type, the top-level cv-qualifiers of A's type are ignored for type deduction.
If A is a reference type, the type referred to by A is used for type deduction.
In general, the deduction process attempts to find template argument values that will make the deduced A identical to A.
However, there are four cases that allow a difference:
  • If the original A is a reference type, A can be more cv-qualified than the deduced A (i.e., the type referred to by the reference).
  • If the original A is a function pointer type, A can be “pointer to function” even if the deduced A is “pointer to noexcept function”.
  • If the original A is a pointer-to-member-function type, A can be “pointer to member of type function” even if the deduced A is “pointer to member of type noexcept function”.
  • The deduced A can be another pointer or pointer-to-member type that can be converted to A via a qualification conversion.
These alternatives are considered only if type deduction would otherwise fail.
If they yield more than one possible deduced A, the type deduction fails.