title: How to assign member function to a member variable, defined using std::function?
body: <p>This is my stripped-down program, where I'm trying to use <em>function variables</em> to modify class functionality at run time. So - I declare a member variable <code>m_func</code> using the <code>std::function</code> template and a function <code>myFunc</code> with compatible signature:</p>
  
  <pre><code>#include &lt;functional&gt;
  #include &lt;iostream&gt;
  
  struct T
  {
    T():m_func([](int){return true;}) {}
    void assign() {m_func = &amp;T::myFunc;}    // &lt;======== Problem is here
    void call(int M) const {std::cout &lt;&lt; m_func(M) &lt;&lt; std::endl;}
  private:
    bool myFunc(int N) {return (N &gt;= 4);}
    using func = std::function&lt;bool(int)&gt;;
    func m_func;
  };
  
  int main()
  {
    T t;
    t.assign();
    t.call(6);
  }
  </code></pre>
  
  <p>However, the compiler (g++ 4.8.4 with -std=c++11 option) gives me an error with long output, saying that <code>template argument deduction/substitution failed</code> and a lot more...</p>
  
  <p>Why can't I assign the <code>myFunc</code> function to the <code>m_func</code> variable? </p>