From: Mikko Rasa Date: Sun, 11 Dec 2022 11:54:17 +0000 (+0200) Subject: Adjust copyability of classes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=afd2a8365ccc49b1b69ca034dd4abae37ee83eed;p=libs%2Fnet.git Adjust copyability of classes In most cases the use of std::unique_ptr already makes classes move-only where necessary. --- diff --git a/source/http/client.h b/source/http/client.h index d79389a..cd53f61 100644 --- a/source/http/client.h +++ b/source/http/client.h @@ -41,8 +41,6 @@ private: std::unique_ptr response; std::string in_buf; - Client(const Client &); - Client &operator=(const Client &); public: ~Client(); diff --git a/source/net/communicator.h b/source/net/communicator.h index 822b16e..b98f488 100644 --- a/source/net/communicator.h +++ b/source/net/communicator.h @@ -2,6 +2,7 @@ #define MSP_NET_COMMUNICATOR_H_ #include +#include #include #include "protocol.h" @@ -23,7 +24,7 @@ public: }; -class Communicator +class Communicator: public NonCopyable { public: sigc::signal signal_handshake_done; diff --git a/source/net/sockaddr.h b/source/net/sockaddr.h index f2f9695..817de4d 100644 --- a/source/net/sockaddr.h +++ b/source/net/sockaddr.h @@ -22,6 +22,10 @@ public: protected: SockAddr() = default; + SockAddr(const SockAddr &) = default; + SockAddr(SockAddr &&) = default; + SockAddr &operator=(const SockAddr &) = default; + SockAddr &operator=(SockAddr &&) = default; public: virtual ~SockAddr() = default;