Given the following program
#include
template struct id { using type = T; };
template
int func(T1, T2
The following func
overload
// Denote as overload F. template
int func(typename id ::type, typename id ::type) { return 1; }
is more specialized than the following func
overload
// Denote as overload G. template
int func(T1, T2) { return 0; }
thus, the former is chosen by overload resolution.
(All ISO Standard references below refer to N4659: March 2017 post-Kona working draft/C++17 DIS)
The partial ordering of the G
and F
overloads of func
is governed by: