std::function with non-static member functions

后端 未结 3 737
我寻月下人不归
我寻月下人不归 2021-01-01 22:54

i\'m trying to understand a concept and an error. what\'s wrong with this?

class A
{
public:
    A()
    {
        std::function testFunc(&a         


        
3条回答
  •  没有蜡笔的小新
    2021-01-01 23:24

    With c++11 you can also use lambdas which are slightly easier to read than std::bind:

    index[WM_CREATE] = [this](HWND h, UINT u, WPARAM w, LPARAM l)
    {
      create(h, u, w, l);
    }
    

提交回复
热议问题