std::bind绑定类函数,提示错误,问题目前还没有解决,

第二个传入是类的话,并且函数带有参数的,会提示错误。 

t->start(1, std::bind(&ZC_Upload::upload_deal, foo,std::placeholders::_1), SimpleTimer::Type::Circle);
  void SimpleTimer::start(uint32_t interval, OnTimerCB cb, AbstractTimer::Type type)
 {
    stop();
 }

 main.cpp:29:17: error: no viable conversion from '__bind &>'
      to 'OnTimerCB' (aka 'function')
    t->start(1, std::bind(&ZC_Upload::upload_deal, foo,std::placeholders::_1), SimpleTimer::Type::Circle);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

你可能感兴趣的:(c++)