[temp.deduct.conv] (original) (raw)

13 Templates [temp]

13.10 Function template specializations [temp.fct.spec]

13.10.2 Template argument deduction [temp.deduct]

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

Template argument deduction is done by comparing the return type of the conversion function template (call itP) with the type that is required as the result of the conversion (call itA; 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 ofP in the remainder of this subclause.

IfAis not a reference type:

IfAis a cv-qualified type, the top-level cv-qualifiers ofA's type are ignored for type deduction.

IfAis a reference type, the type referred to byAis used for type deduction.

In general, the deduction process attempts to find template argument values that will make the deducedAidentical toA.

However, there are four cases that allow a difference:

These alternatives are considered only if type deduction would otherwise fail.

If they yield more than one possible deducedA, the type deduction fails.