Be more generic. Use a template parameter for the entire function parameter. Then you can pass function-like objects ("functors") and C++0x lambdas instead of normal functions if you want to.