title: std::map C2678 binary '<': no operator found which takes a left-hand operand of type 'const sockaddr_in'
body: <p>I'm trying to make a client list for a UDP Server.</p>
  
  <pre><code>#ifndef WIN32_LEAN_AND_MEAN
  #define WIN32_LEAN_AND_MEAN
  #endif
  
  #include "stdafx.h"
  #include &lt;map&gt;
  #include &lt;unordered_map&gt;
  #include &lt;WS2tcpip.h&gt;
  #include &lt;WinSock2.h&gt;
  #include &lt;Windows.h&gt;
  
  #pragma comment(lib, "Ws2_32.lib")
  
  
  std::map&lt;sockaddr_in, int&gt; clientList;
  
  ....
  void Listen(){
      sockaddr_in client;
      [...]
      if (clientList.find(client) == clientList.end()) {
          printf("Got a new client!\n");
          std::pair&lt;sockaddr_in, uint64_t&gt; item(client, rand());
          clientList.insert(item);
      }
  }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>C2678 binary '&lt;': no operator found which takes a left-hand operand of type 'const sockaddr_in'
  </code></pre>
  
  <p>I also tried using unordered_map which gives me the following error:</p>
  
  <pre><code>C2280 'std::hash&lt;_Kty&gt;::hash(const std::hash&lt;_Kty&gt; &amp;)' :attempting to reference a deleted function
  </code></pre>
  
  <p>It compiles fine when I only declare the map. I can't seem to figure out what's wrong since sockaddr_in is defined by WinSock2. I'm using VS2017.</p>