
29 Oct
2009
29 Oct
'09
1:15 p.m.
AMDG Igor R wrote:
(lambda::var(member_) = 5)
Did you mean &my_obj::member_?
No. I meant exactly what I said.
But anyway, it doesn't compile.
The following works fine. #include <boost/lambda/lambda.hpp> #include <boost/function.hpp> #include <cassert> struct S { int member_; void f() { boost::function<void()> f_(boost::lambda::var(member_) = 5); f_(); } }; int main() { S s; s.f(); assert(s.member_ == 5); }
My real code should look like this:
io_service.post(lambda::var(member_)=5); // posts to another thread and performs the assignment there
In Christ, Steven Watanabe