Created on 2013-12-30.00:00:00 last changed 83 months ago
[Moved to DR at the November, 2016 meeting.]
Proposed resolution (June, 2016):
This issue is resolved by the resolution of issue 1395.
Notes from the February, 2014 meeting:
CWG felt that the best approach would be, when comparing P and A, if A is a pack and P is not, A should be repeated for each remaining instance of P and then use the variadic/nonvariadic criterion as a late tiebreaker if the result is still ambiguous. This would apply in the general case (including 13.10.3.5 [temp.deduct.partial]), not just in function calls.
Given the following example,
template <class ...T> int f(T*...) { return 1; } template <class T> int f(const T&) { return 2; } void g() { f((int*)0); }
the current specification makes the call ambiguous because deduction fails in both directions: with A being T and P being T* in one direction and A being T* and P being T, because 13.10.3.5 [temp.deduct.partial] paragraph 8 says,
If A was transformed from a function parameter pack and P is not a parameter pack, type deduction fails.
It is not clear whether this is the best outcome, however; it might be better to consider the first template more specialized, with the variadic/non-variadic test being a tie-breaker if there is no other reason to prefer one over the other based on the parameter types.
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-02-27 00:00:00 | admin | set | messages: + msg6172 |
2018-02-27 00:00:00 | admin | set | status: dr -> c++17 |
2017-02-06 00:00:00 | admin | set | messages: + msg6095 |
2017-02-06 00:00:00 | admin | set | status: drafting -> dr |
2014-03-03 00:00:00 | admin | set | messages: + msg4899 |
2014-03-03 00:00:00 | admin | set | status: open -> drafting |
2013-12-30 00:00:00 | admin | create |