boost :: bind如何在C ++中传递参数?

问题描述 投票:0回答:2

我在理解这些代码行的某些部分时遇到麻烦:

fn_ = boost::bind(&CheckFeasibility, this, &world_, _1, _2, _3 );

if (robot_state_->setFromIK(arg1, arg2, arg3, arg4, arg5, fn_ ))

第一行中this的目的是什么,何时以及如何确定并传递CheckFeasibility的参数?

这里是CheckFeasibility函数的样子(我省略了参数的数据类型):

bool CheckFeasibility(*world, *state, *grp, *values)

谢谢

c++ this ros boost-bind moveit
2个回答
0
投票

boost::bind为您提供了一个函数,该函数映射其参数以调用另一个函数,然后可选地添加它已经知道的一些函数。它现在是标准的一部分,因此您可以在cppreference中阅读更多内容。


0
投票

boost::bind用于bind

© www.soinside.com 2019 - 2024. All rights reserved.