title: No viable overloaded '=' for assigning std::function callback as member function
body: <p>I'm trying to hook a member function up to an <code>std::function</code> callback. The callback type is: </p>
  
  <pre><code>std::function&lt;void(Touch*, Event*)&gt;
  </code></pre>
  
  <p>My member function is:</p>
  
  <pre><code>void Game::onTouchEnded(Touch* touch, Event* event)
  </code></pre>
  
  <p>When I try to assign the callback using the following:</p>
  
  <pre><code>listener-&gt;onTouchEnded = bind(&amp;Game::onTouchEnded, this);
  </code></pre>
  
  <p>I get a <code>No viable overloaded '='</code> error with several candidates. Here are the details of the one I believe to be most relevant:</p>
  
  <pre><code>Candidate function not viable: no known conversion from 
  '__bind&lt;void (Game::*)(cocos2d::Touch *, cocos2d::Event *), Game *&gt;'
  to
  'std::__1::function&lt;void (cocos2d::Touch *, cocos2d::Event *)&gt;'
  for 1st argument`
  </code></pre>
  
  <p>I've tried several different bind() arrangements but I'm not sure what the error is telling me. The types all seem to be correct in terms of the parameters and return value so I'm not sure why it won't accept it?</p>