How would the compiler, and the user, figure out where the parameter pack ends, and the next template parameter pack starts?
I suppose you could work out that the template parameter pack is only the first argument in your example, but it feels very complicated to figure this out.
This being said, it would be nice if this were possible, since it can be useful to have template parameters after template parameter packs (I've personally run into this issue, but I've been able to solve it with workarounds).
One potential problem I see is something like this:
template<typename ... Ts, typename U>
void Foo()
{
std::cout << sizeof ... (Ts) << ", " << sizeof(U) << "\n"; // dummy code
}
int main()
{
Foo<int>();
}How does the compiler figure this one out? Ts can be empty, but it could also match the supplied int.
You could match the parameter pack to be empty and U to be the int, but this seems like a complicated problem, that I'm sure can be made far more complex than what I can come up with on the fly.
Sincerely,