Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::bind in registerCallback failed ? #145

Open
lix19937 opened this issue Sep 2, 2024 · 1 comment
Open

std::bind in registerCallback failed ? #145

lix19937 opened this issue Sep 2, 2024 · 1 comment
Labels
more-information-needed Further information is required

Comments

@lix19937
Copy link

lix19937 commented Sep 2, 2024

code snipnet

            img_sync_camera_->registerCallback(std::bind(&HavpIMPNode::SubMsgCallbackCamera,
                                                         this,
                                                         std::placeholders::_1,
                                                         std::placeholders::_2,
                                                         std::placeholders::_3,
                                                         std::placeholders::_4));

compile error


 error: no matching function for call to ‘bind(<unresolved overloaded function type>, HavpIMPNode*, const std::_Placeholder<1>&, const std::_Placeholder<2>&, const std::_Placeholder<3>&, const std::_Placeholder<4>&)’
  219 |                                                          std::placeholders::_4));

but if use boost bind, it passed.

            img_sync_camera_->registerCallback(boost::bind(&HavpIMPNode::SubMsgCallbackCamera,
                                                            this,
                                                            _1,
                                                            _2,
                                                           _3,
                                                           _4));
@clalancette
Copy link
Contributor

We have a test that tests exactly this situation:

sync_.registerCallback(
std::bind(
&ApproximateTimeSynchronizerTestQuad::callback, this, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4));
.

Can you give more details about the signature to your SubMsgCallbackCamera method?

@clalancette clalancette added the more-information-needed Further information is required label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

2 participants