You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each type nominated above from the parameter template and the corresponding type from the argument template are used as the types of P and A. If a particular P contains no template-parameters that participate in template argument deduction, that P is not used to determine the ordering.
After CWG2235, the emphasized wording was removed. Consider this example
According to [temp.deduct.partial#3.1], the P/A pairs are formed from function parameter types without other requirements. Hence, in this partial ordering, the set of P/A pairs that determine the ordering consists of
P = typename unknow_content<T>::type / A = T' , P = T / A = U'
P = T' / A = typename unknow_content<T>::type , P = U' / A = T
Which is more specialized than the other is essentially determined by that
If deduction succeeds for a given type, the type from the argument template is considered to be at least as specialized as the type from the parameter template.
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.
Without the impact of the removed rule
If a particular P contains no template-parameters that participate in template argument deduction, that P is not used to determine the ordering.
[temp.deduct.type] p4
In certain contexts, however, the value does not participate in type deduction, but instead uses the values of template arguments that were either deduced elsewhere or explicitly specified.
does not apply here since P = typename unknow_content<T>::type does participate in deduction.
We can arguably says, the deduction fails for this pair P = typename unknow_content<T>::type / A = T' since that
If type deduction cannot be done for any P/A pair, ..., template argument deduction fails
Hence, in this example, #1 should have been more specialized than #2 after CWG2235, however, all implementations say they're ambiguous. See https://godbolt.org/z/9P1Tjr3WK
The text was updated successfully, but these errors were encountered:
In c++17, [temp.deduct.partial] p4 says
After CWG2235, the emphasized wording was removed. Consider this example
According to [temp.deduct.partial#3.1], the P/A pairs are formed from function parameter types without other requirements. Hence, in this partial ordering, the set of P/A pairs that determine the ordering consists of
Which is more specialized than the other is essentially determined by that
Without the impact of the removed rule
[temp.deduct.type] p4
does not apply here since
P = typename unknow_content<T>::type
does participate in deduction.We can arguably says, the deduction fails for this pair
P = typename unknow_content<T>::type / A = T'
since thatHence, in this example,
#1
should have been more specialized than#2
after CWG2235, however, all implementations say they're ambiguous. See https://godbolt.org/z/9P1Tjr3WKThe text was updated successfully, but these errors were encountered: