template<typename F1, typename F2>
struct MyAlgorithm {
F1 f1; F2 f2;
void operator()(...) { ... f1(whatever); ... f2(whatever); }
};
you can't just pass functions to F1 or F2, they have to be objects.I remember this happening to me at least half a dozen times so far so now I just don't waste time and write them as structs with an operator() directly if it's anything that is meant to be used as a callback somewhere.
See also item 46 on Scott Meyers' "Programming with the STL" which points out a few other issues which can arise from using functions.