// variadic function template template void fun(Params ...parameters) {} // instantiation declaration template void fun(int v); // pointers to functions that are instantiated from a variadic function // template void (*fp)(int) = fun; void (*fp2)(int, double) = fun; // template class having variadic function template member template struct Demo { template void mem(Params ...parameters) {} }; // instantiation declaration: template void Demo::mem(int v); // pointers to functions that are instantiated from a variadic function // template void (Demo::*mp)(int) = &Demo::mem; void (Demo::*mp2)(int, double) = &Demo::mem; // explicitly obtain the address of the Demo::mem member expecting an int: void (Demo::*mp1)(int) = //&Demo::mem(int); // error meesage: expected primary-expression before 'int' &Demo::mem; // OK // a template class using perfect forwarding: template struct Demo2 { template void mem(Args&&...args) {} }; // instantiation declaration: template // void Demo2::mem(int v); // error: template-id 'mem' for 'void Demo2::mem(int)' does // not match any template declaration // void Demo2::mem(Args &&...args); // error: using 'typename' outside of template // expected parameter pack before '...' // parse error in template argument list // template-id 'mem< >' used as a declarator // variable or field 'mem' declared void // expected `;' before '(' token void Demo2::mem(int &&); // or: void Demo2::mem(int &&); // pointers to Demo2::mem: //OK void (Demo2::*mpd2)(int &&) = &Demo2::mem; void (Demo2::*mpd2)(int &&) = &Demo2::mem; // ook OK