I'm trying to do something like this:
template <class ... Required>
class Base
{
template <class First, class ... Rest>
void bar(First f, Rest ... r)
{
[...]
return bar(r...);
}
void bar()
{
return;
}
public:
template <class ... Optional>
void foo(Required ... r, Optional ... o)
{
[...]
bar(r...); //separate the required from the optional
bar(o...);
}
};
class Child : Base<Foo1, Foo2>
{
public:
Child()
{
[...]
foo(foo1,foo2,foo3);
}
}
But the first bar call is receiving all the parameters instead of only the Required ones, and the second call is receiving none of the parameters. Did I miss something about multiple variadic parameters? Shouldn't the compiler know that Required... is Foo1,Foo2 and the rest is Optional?