Is it possible to create a a variadic template function? Something like this:
I don't want to make Foo and Bar have variadic constructors.
Code:
class Foo {
...
Foo(int x);
...
};
class Bar {
...
Bar(int x, double y);
...
};
template<typename T> class Template {
...
static void method(...) {
T t(...); // variadic call
...
}
};
int main() {
Template<Foo>::method(5);
Template<Bar>::method(5, 0.3);
}
Comment