[temp.deduct.conv] (original) (raw)
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]
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:
- IfPis an array type, the pointer type produced by thearray-to-pointer standard conversion is used in place ofPfor type deduction; otherwise,
- IfPis a function type, the pointer type produced by thefunction-to-pointer standard conversion is used in place ofPfor type deduction; otherwise,
- IfPis a cv-qualified type, the top-level cv-qualifiers ofP's type are ignored for type deduction.
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, certain attributes of A may be ignored:
- If the original A is a reference type, any cv-qualifiers of A(i.e., the type referred to by the reference).
- If the original A is a function pointer or pointer-to-member-function type with a potentially-throwing exception specification ([except.spec]), the exception specification.
- Any cv-qualifiers in Athat can be restored by a qualification conversion.
These attributes are ignored only if type deduction would otherwise fail.
If ignoring them allows more than one possible deducedA, the type deduction fails.