Skip to content

std::bind in registerCallback failed ?  #145

@lix19937

Description

@lix19937

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions