#include template struct method_choice; template struct method_choice { template method_choice(int choice, C &subject, A... args) { if (choice == 0) { (subject.*PMF)(std::forward(args)...); } else { method_choice(choice - 1, subject, std::forward(args)...); } } }; template struct method_choice { template method_choice(int, C &, A...) { // die? } }; extern volatile int poop; struct what { void f(int x) { poop += x; } void g(int x) { poop *= x; } void h(int x) { poop -= x; } }; void hello(int k) { what w; method_choice(k, w, 42); }