17 Jul
2008
17 Jul
'08
1:24 p.m.
You need to make the call. The following does NOT seem to work, and I'm not sure why:
for_each (functors.begin(), functors.end(), _1());
Well, that was the experssion I started with. But since it doesn't compile, I thought probably _1 evaluates to (*functor)()...
But the following does work:
void call(function
f) { f(); } ... for_each (functors.begin(), functors.end(), call);
Yes, sure, but I'd like to create & call in-place lambda functor - with no complicated bindings etc. - just a trivial one. And I still don't belive it's impossible :-)