I am facing the following inconsistency between gcc10.2 and clang11:
template<typename ... Args, typename T>
static constexpr int fuu = sizeof(T);
clang complains that a template pack must be the last thing in the template declaration:
error: template parameter pack must be the last template parameter
template<typename ... Args, typename T>
but gcc is cool with it.
See https://godbolt.org/z/v9KeW6
Is this "last thing" actually a rule? In a function this works with both compilers.
template<typename... Args, typename T>
int foo(T) {
return sizeof(T);
}
I don't see a reason why the first snippet shouldn't work, the template arguments are unambiguously deducible.