title: VS2013 std::function with member function
body: <p>I'm trying to use std::function with member functions like this:</p>
  
  <pre><code>struct Foo
  {
     void bar(int) const { /* ... */ }
  };
  
  //later on
  std::function&lt;void(const Foo&amp;, int)&gt; fun = &amp;Foo::bar;
  </code></pre>
  
  <p>This works under GCC 4.8.1 but fails to compile under VS2013 with the following error:</p>
  
  <pre><code>error C2664: 'void std::_Func_class&lt;_Ret,const Foo &amp;,int&gt;::_Set(std::_Func_base&lt;_Ret,const Foo &amp;,int&gt; *)' :
  cannot convert argument 1 from '_Myimpl *' to 'std::_Func_base&lt;_Ret,const Foo &amp;,int&gt; *'
  </code></pre>
  
  <p>It looks to me like a bug in VS but maybe I'm not seeing something? Is there a way to workaround it (without external libs like boost)?</p>
  
  <p><strong>Edit:</strong> I forgot "const" in bar signature. But this still doesn't work in VS.</p>