<分区>
Possible Duplicate:
template pass by value or const reference or…?
以下对于将函数作为参数的函数的最佳做法是什么:
template<class Function> void test1(Function f);
template<class Function> void test2(Function& f);
template<class Function> void test3(const Function& f);
其中传递的函数可以是仿函数、std::function、函数指针或 lambda 函数。