Igor R.
2010-09-08 13:23:39 UTC
Hello,
I'm trying to integrate lambdas into a legacy code. The original line
looks like this:
someQueue_->post(bind(&MyClass::func, shared_from_this()));
Now I'd like to use the new lambda feature:
someQueue_->post([&] {func()});
Of course, it captures "this" by reference, but in addition now I have
to store the result of shared_from_this() call.
Is it possible to do this without additional bind's etc?
Thanks.
I'm trying to integrate lambdas into a legacy code. The original line
looks like this:
someQueue_->post(bind(&MyClass::func, shared_from_this()));
Now I'd like to use the new lambda feature:
someQueue_->post([&] {func()});
Of course, it captures "this" by reference, but in addition now I have
to store the result of shared_from_this() call.
Is it possible to do this without additional bind's etc?
Thanks.