C++ How do you pass a member function into a functor parameter?

前端 未结 2 1653
抹茶落季
抹茶落季 2021-01-23 00:16

I am using TRI DDS - here is the prototype for the function I am trying to call:

template
dds::sub::cond::ReadCondition::Re         


        
2条回答
  •  伪装坚强ぢ
    2021-01-23 00:55

    You can use a lambda function with a capture.

    dds::sub::cond::ReadCondition rc(*mp_reader,
                                     dds::sub::status::DataState::any(),
                                     [this](){ this->do_stuff(); });
    

提交回复
热议问题