I have a QThread based class, basically a GUI thread. In this thread I'm using another class which have this function type definition:
void SomFunc(const std::function<void (int, std::string, int)> &data)
I want to create a callback function in my class like MyThread::Callback and call above function and pass my MyThread::Callback function as actual callback function. Whatever I try, I miss something at the end, I'm really confused with std::function thing and need help. How do I define a function that I can pass as argument to SomFunc
and get proper callbacks in my MyThread class context
If I simply create a void function this is what I get:
error: reference to type 'const std::function<void (int, std::string, int)>' (aka 'const function<void (int, basic_string<char>, int)>') could not bind to an rvalue of type 'void (MyClass::*)(int, std::string, int)'