passing member-function as argument to function-template
问题 Consider three ways to implement a routine in c++: through functors, member functions, and non-member functions. For example, #include <iostream> #include <string> using std::cout; using std::endl; using std::string; class FOO { public: void operator() (string word) // first: functor { cout << word << endl; } void m_function(string word) // second: member-function { cout << word << endl; } } FUNCTOR; void function(string word) // third: non-member function { cout << word << endl; } Now