title: xrefwrap error: 'void' function returning a value
body: <p>I have got this weird error when compiling my project with Visual Studio 2012:</p>
  
  <p><code>error C2562: 'std::_Callable_obj&lt;_Ty&gt;::_ApplyX' : 'void' function returning a value    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xrefwrap</code></p>
  
  <p>When jumping in <code>xrefwrap</code>, the error comes from this line:</p>
  
  <p><code>_VARIADIC_EXPAND_0X(_APPLYX_CALLOBJ, , , , )</code></p>
  
  <p>My code compiles fine with GCC on Linux.. Plus the compiler gives me no information on what is causing this error.</p>
  
  <p>What could be the cause of this error? I suspect this piece of code might be the source, but only because I use <code>std::ref</code> there:</p>
  
  <pre><code>_listener.addSocket(clientSock, std::bind(&amp;Client::handleReceive, &amp;client,
                                            _1, std::ref(*this)),
                      std::bind(&amp;Lounge::handleClientDisconnect, this,
                                std::cref(client)));
  </code></pre>
  
  <p>Here are the two signatures of the member functions I am binding:</p>
  
  <pre><code>bool  Client::handleReceive(std::shared_ptr&lt;TBSystem::network::sockets::ITcpSocket&gt;&amp; socket,
                          Lounge&amp; lounge);
  
  void  Lounge::handleClientDisconnect(const Client&amp; c);
  </code></pre>
  
  <p>I do return a value in <code>Client::handleReceive</code>.</p>
  
  <p>And this is the two <code>std::function</code> prototypes I am using when calling <code>addSocket</code>:</p>
  
  <pre><code>typedef std::function&lt;bool (std::shared_ptr&lt;sockets::ITcpSocket&gt;&amp;)&gt; readCallback;
  typedef std::function&lt;void ()&gt; disconnectCallback;
  </code></pre>