fpagliughi / sockpp

Modern C++ socket library.
BSD 3-Clause "New" or "Revised" License
792 stars 126 forks source link

Add missing move constructor for connector template #60

Closed mcopik closed 2 years ago

mcopik commented 2 years ago

The main template class of tcp_connector is missing a move constructor - it is in the base class, but not in the derived class.

This makes it impossible to use connections with std::vector, as it requires a move or a copy constructor.

#include <vector>

#include <sockpp/tcp_connector.h>

void foo()
{
  sockpp::tcp_connector conn;
  std::vector<sockpp::tcp_connector> connections;
  connections.push_back(std::move(conn));
}
fpagliughi commented 2 years ago

Oh, of course. Thanks!