title: No matching constructor for initialization of 'xxx'
body: <p>I want to implement a tcp server based on libevent, in which server_socket is responsible for establishing the connection, server_connect encapsulates the client connection as a class for handling read and write requests, but I need to <strong>save the server_socket reference in the server_connect class</strong>.</p>
  <p>Declaration of this class:</p>
  <pre><code>class server_connect final {
  
  public:
      explicit server_connect(server_socket &amp;, int, event_base *);
      ...
  
  private:
      server_socket &amp;server_sock;
      ...
  
  };
  </code></pre>
  <p>Save the server_connect object in the map in another function</p>
  <pre><code>typedef std::pair&lt;int, server_connect&gt; connect_pair;
  
  // callback function for accept event
  void tcp_accept_handler(int socket_fd, short events, void *arg) {
      auto server_sk_ptr = (server_socket*) arg;
      ...
      // When the code here calls the server_connect constructor, it prompts that the corresponding constructor cannot be found
      server_sk_ptr-&gt;connect_map.insert(connect_pair(client_sock_fd, server_connect(*server_sk_ptr, client_sock_fd, server_sk_ptr-&gt;ev_base)));
  }
  </code></pre>
  <blockquote>
  <p>I'm not very good at English so there may be some grammatical errors. thanks for your answer :)</p>
  </blockquote>