Passing a function object: Error
What's wrong with the following little program that passes a function object? #include <iostream> #include <functional> void foo(const std::unary_function<const std::string&, void>& fct) { const std::string str = "test"; fct(str); // error } class MyFct : public std::unary_function<const std::string&, void> { public: void operat...