title: Invalid use of non-static member function int test::funcAB(int, int)
body: <p>I've got some problem using <code>std::function</code></p>
  
  <p>It works with static int <code>funcAB</code> but, in reality, I need std function for non-static in class.</p>
  
  <pre><code>#include &lt;functional&gt;
  #include &lt;iostream&gt;
  
  class test{   
      public:
      std::function&lt;int (int, int)&gt; func;
      int funcAB(int a, int b){
          return a + b;
      }
      test(){
          func = test::funcAB;
      }
  };
  
  int main(){
      using namespace std;
      test A;
      cout &lt;&lt;A.funcAB(10,11) &lt;&lt; endl;
      cout &lt;&lt;A.func(11,12) &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>main.cpp:11:22: error: invalid use of non-static member function ‘int test::funcAB(int, int)’
           func = test::funcAB;
                        ^~~~~~
  </code></pre>