The problem is that we cannot simply expand the parameter package and call it inside the function body, because this is not a valid context.
void c() { T::m()...;
There are many tricks to get around this. The one I usually use uses std::initializer_list :
void c() { (void)std::initializer_list<int> { (T::m(), 0)... };
Demo
In C ++ 17, we get fold expressions , which will greatly simplify the situation:
void c() { (T::m(), ...);
source share