From afd2a8365ccc49b1b69ca034dd4abae37ee83eed Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 11 Dec 2022 13:54:17 +0200 Subject: [PATCH] Adjust copyability of classes In most cases the use of std::unique_ptr already makes classes move-only where necessary. --- source/http/client.h | 2 -- source/net/communicator.h | 3 ++- source/net/sockaddr.h | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) 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; -- 2.43.0