title: Understanding Error C2664: Cannot convert argument 1
body: <p>The following code snippet </p>
  
  <pre><code>#include "uWS/uWS.h"
  
  int main()
  {
    uWS::Hub h;
    h.onConnection([&amp;h](uWS::WebSocket&lt;uWS::SERVER&gt; *ws, uWS::HttpRequest req) {
      std::cout &lt;&lt; "Connected!!!" &lt;&lt; std::endl;
    });
    h.run();
  }
  </code></pre>
  
  <p>Generates the errors</p>
  
  <blockquote>
    <p><code>Severity Code    Description Project File    Line    Suppression State Error
    (active)  E0304   no instance of overloaded function
    "uWS::Hub::onConnection" matches the argument
    list  pid c:\Users\R\src\main.cpp 6    Error  C2664   'void
    uWS::Group&lt;false&gt;::onConnection(std::function&lt;void
    (uWS::WebSocket&lt;false&gt;,uWS::HttpRequest)&gt;)': cannot convert argument 1
    from 'main::&lt;lambda_1afdd040d2f03ded23f0c636dc85475d&gt;' to
    'std::function&lt;void
    (uWS::WebSocket&lt;true&gt;,uWS::HttpRequest)&gt;' pid c:\users\r\src\main.cpp 8</code></p>
  </blockquote>
  
  <p>When built in Visual Studio 2017 IDE using Windows SDK Version 10.0.15063.0, 
  where "uWS/uWS.h" contains the <a href="https://github.com/uWebSockets/uWebSockets" rel="nofollow noreferrer">tiny web sockets definitions</a></p>
  
  <p>What could be the problem?</p>