Compare the invocation of foo() and bar() with an arbitrary amount of arguments. I can call bar() and constrain the parameter type to B but just in the case I equip B with a parameter pack. If I don't (like in A), gcc doesn't allow me to specify the exact type of the parameters passed and I would have to use a generic type and constrain it with std::enable_if or static_asserts.
Just out of curiosity, why isn't this possible? It would be much clearer and consiser than using enable_if's or asserts.
#include <vector>
#include <iostream>
struct A { };
template <bool F>
struct B { };
void foo(A... nr)
{
// doesn't work
}
template <bool... F>
void bar(B<F>... nr)
{
// does work
}
int main()
{
A a1, a2, a3;
B<true> b1, b2, b3;
foo(a1, a2, a3);
bar(b1, b2, b3);
}