#include <tuple>
template<int I>
struct A {};
template<int I, typename... T>
void f(A<I>, std::tuple<T *...>) {}
template<typename... T>
void f(A<0>, std::tuple<T *...>) {}
int main()
{
f(A<0>{}, std::tuple<char*, int*, float*>{});
}
Isn't the second overload of f
more specialized? g++ 4.9.2 says that the call is ambiguous, clang 3.6.0 accepts it. Which compiler is right?
It's interesting that if you change std::tuple<T *...>
to std::tuple<T...>
, g++ is fine with it, which I don't understand.