[move] move emulation with bind?

hi all, i'm trying to make one of my classes movable. however i have some issues when using it with boost::bind: class my_movable_class; void my_function(my_movable_class const &); this doesn't compile: boost::bind(my_function, boost::move(my_movable_class)) the reason is, that the members of boost::rv are private ... is this my fault or an issue with the move emulation? thanks, tim -- tim@klingt.org http://tim.klingt.org Just what the hell is the experimental tradition? Morton Feldman

On 24/07/2010 17:21, Tim Blechmann wrote:
hi all,
i'm trying to make one of my classes movable. however i have some issues when using it with boost::bind:
class my_movable_class; void my_function(my_movable_class const&);
this doesn't compile: boost::bind(my_function, boost::move(my_movable_class))
the reason is, that the members of boost::rv are private ...
is this my fault or an issue with the move emulation?
thanks, tim
If you catch by const reference, then why do you call move()? Bind copies arguments so I think it won't work with boost::rv unless bind recognizes it as an special class and forwards it accordingly. Compatibility with bind should be in the to-do list once move is accepted. Best, Ion

i'm trying to make one of my classes movable. however i have some issues when using it with boost::bind:
class my_movable_class; void my_function(my_movable_class const&);
this doesn't compile: boost::bind(my_function, boost::move(my_movable_class))
the reason is, that the members of boost::rv are private ...
is this my fault or an issue with the move emulation?
thanks, tim
If you catch by const reference, then why do you call move()?
broken out of a more complex use case (i am using boost.bind to create callback objects, that are passed between threads ... the payload should be moved along ...
Bind copies arguments so I think it won't work with boost::rv unless bind recognizes it as an special class and forwards it accordingly.
i see ... i'll test it, when it is ready! thanks, tim -- tim@klingt.org http://tim.klingt.org Most of the trouble in this world has been caused by folks who can't mind their own business, because they have no business of their own to mind, any more than a smallpox virus has. William S. Burroughs

On 26/07/2010 11:22, Mathias Gaunard wrote:
Le 25/07/2010 18:20, Ion Gaztañaga wrote:
Compatibility with bind should be in the to-do list once move is accepted.
What is the status of the review by the way? Still looking for a review manager?
The library was reviewed in May, I am waiting for the review results: http://www.boost.org/community/review_schedule.html Best, Ion
participants (3)
-
Ion Gaztañaga
-
Mathias Gaunard
-
Tim Blechmann