Is a c++11 variadic function template overload with a dependent type ambiguous?
问题 The following code is a textbook example of a recursive variadic function overload. In both clang and GCC, it compiles cleanly, and main returns 36 (as expected): template <typename T> int add(T val) { return val; } template <typename FirstTypeT, typename... RestT> int add(FirstTypeT first_value, RestT... rest) { return first_value + add<RestT...>(rest...); } int main(void) { return add(12, 12, 12); } However, here is a slight modification. It uses a dependent type in the template definition