template<class F, class T>void foo(F f, T x){ f(x);} void bar(int){}void bar(double){} int main(){ foo<void(int)>(bar, 5);}
Standard input is empty
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!