#include #include template class Dispatcher { public: void dispatch(int x, Ts&& ...args) { if (x > 0) call(std::forward(args)...); else call(std::forward(args)...); } protected: template void call(Ts&& ...args) { throw std::runtime_error("Not implemented"); } }; class bla {}; template<> template void Dispatcher::call(int&& a, char&& b, double&& c) { std::cout << typeid(T).name() << " " << a << " " << b << " " << c << std::endl; } main() { std::cout << "main()" << std::endl; Dispatcher d; d.dispatch(5, 1, 'a', 5.5); d.dispatch(-5, 1, 'a', 5.5); }