ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@RicoJ This question is not really related to ROS and you may want to search or ask in other forums like stackoverflow, but I will answer your question.

boost::bind is a special function used to create a functor for you with the arguments you pass to it. So, it basically creates a new function with the arguments; the problem here is that, if you want to bind a member function you really need to pass, apart from the special placeholders : _1, _2, that store the function arguments, the reference to the object context, that is the special word this.

So the first argument is the reference to the member function, the second, the context of the object itself and then the arguments. If you do not supply the context, the function itself cannot be defined properly within the member scope.

Hope that solve your question.

Regards.