[lambda] delayed assignment to a member
Hello,
How can I create a functor, which would assign to a member variable,
when invoked? I mean, something like this:
int member_;
//...
lambda::bind(my_obj::member_, this, 5);
The above bind itself compiles, but if I try to invoke it or to assign
to a function
AMDG Igor R wrote:
How can I create a functor, which would assign to a member variable, when invoked? I mean, something like this:
int member_; //...
lambda::bind(my_obj::member_, this, 5);
The above bind itself compiles, but if I try to invoke it or to assign to a function
, it doesn't compile.
(lambda::var(member_) = 5) In Christ, Steven Watanabe
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
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
participants (2)
-
Igor R
-
Steven Watanabe