Can lambda\'s be defined as class members?
For example, would it be possible to rewrite the code sample below using a lambda instead of a function object?
#include struct Foo { std::function bar; }; void hello(const std::string & name) { std::cout << "Hello " << name << "!" << std::endl; } int test_foo() { Foo f; f.bar = std::bind(hello, "John"); // Alternatively: f.bar = []() { hello("John"); }; f.bar(); }