Following is my code:
class A {};
class Test
{
public:
template <class TClass>
Test(TClass* _objPointer, void(TClass::*_func)(A*))
{
mEventFunction = std::bind(_func, _objPointer);
}
private:
std::function<void(A*)> mEventFunction;
};
class Demo
{
public:
void BindFunc()
{
mTest = new Test(this, &Demo::testFunc);
}
void testFunc(A*)
{
}
private:
Test* mTest;
};
What I want to achieve is BindFunc() in Demo class. But this code run with lot of error message: error C2672: 'std::invoke': no matching overloaded function found ......
std::bind(_func, _objPointer, std::placeholders::_1).