boost::bind & boost::function pointers to overloaded or templated member functions

前端 未结 2 1456
感动是毒
感动是毒 2020-12-14 20:20

I have a callback mechanism, the classes involved are:

class App
{
    void onEvent(const MyEvent& event);
    void onEvent(const MyOtherEvent& event         


        
2条回答
  •  星月不相逢
    2020-12-14 21:09

    You are going to want to do

    boost::function g = boost::bind(&App::OnEvent, this, _1);
    

    You should be able to do g(event); with that

    I am not quite sure what you are trying to accomplish here, but that should solve one of your problems for now.

提交回复
热议问题