I have a libsigc++
signal which is connected to a c++11 lambda.
sigc::signal<void, std::string> foo;
foo.connect([](string s) { cout << s << endl; });
foo.emit(string("Hello"));
I want to change the signal's return type from void
to non-void
sigc::signal<int, std::string> foo;
foo.connect([](string s) { return s.size(); });
cout << foo.emit(string("Hello")) << endl;
This gives an error:
void value not ignored as it ought to be
Is this usage pattern possible with lambdas?