From: Mikko Rasa Date: Fri, 9 Dec 2022 22:03:22 +0000 (+0200) Subject: Mark special member functions as defaulted where appropriate X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d11d422d06ca0277dff4860a0bf71b1844c94b8a;p=libs%2Fnet.git Mark special member functions as defaulted where appropriate --- diff --git a/source/http/header.h b/source/http/header.h index c3d07f3..0c6324b 100644 --- a/source/http/header.h +++ b/source/http/header.h @@ -33,7 +33,7 @@ struct Header std::string raw_value; std::vector values; - Header() { } + Header() = default; Header(const Message &, const std::string &, Style = DEFAULT); Header(const std::string &, const std::string &, Style = DEFAULT); diff --git a/source/http/message.h b/source/http/message.h index e525360..7acce90 100644 --- a/source/http/message.h +++ b/source/http/message.h @@ -23,7 +23,7 @@ protected: Message(); public: - virtual ~Message() { } + virtual ~Message() = default; void set_header(const std::string &, const std::string &); bool has_header(const std::string &) const; diff --git a/source/http/response.h b/source/http/response.h index bb471f0..8d88c92 100644 --- a/source/http/response.h +++ b/source/http/response.h @@ -12,7 +12,7 @@ class Response: public Message private: Status status; - Response() { } + Response() = default; public: Response(Status); Status get_status() const { return status; } diff --git a/source/http/submessage.h b/source/http/submessage.h index f60276a..9cf4d2c 100644 --- a/source/http/submessage.h +++ b/source/http/submessage.h @@ -9,7 +9,7 @@ namespace Http { class SubMessage: public Message { private: - SubMessage() { } + SubMessage() = default; public: virtual std::string str() const; diff --git a/source/net/protocol.h b/source/net/protocol.h index cd68d51..aca3ca8 100644 --- a/source/net/protocol.h +++ b/source/net/protocol.h @@ -36,7 +36,7 @@ private: template struct CompoundTypeDef { - virtual ~CompoundTypeDef() { } + virtual ~CompoundTypeDef() = default; virtual std::string describe() const = 0; virtual char *serialize(const C &, char *, char *) const = 0; @@ -165,7 +165,8 @@ private: PacketDefBase(unsigned); public: - virtual ~PacketDefBase() { } + virtual ~PacketDefBase() = default; + virtual unsigned get_class_id() const = 0; unsigned get_id() const { return id; } virtual std::string describe() const = 0; diff --git a/source/net/receiver.h b/source/net/receiver.h index 19e69e0..de7209e 100644 --- a/source/net/receiver.h +++ b/source/net/receiver.h @@ -7,16 +7,16 @@ namespace Net { class ReceiverBase { protected: - ReceiverBase() { } + ReceiverBase() = default; public: - virtual ~ReceiverBase() { } + virtual ~ReceiverBase() = default; }; template class PacketReceiver: public virtual ReceiverBase { protected: - PacketReceiver() { } + PacketReceiver() = default; public: virtual void receive(const P &) = 0; }; diff --git a/source/net/sockaddr.h b/source/net/sockaddr.h index aad5e29..9db8b18 100644 --- a/source/net/sockaddr.h +++ b/source/net/sockaddr.h @@ -13,9 +13,9 @@ public: struct SysAddr; protected: - SockAddr() { } + SockAddr() = default; public: - virtual ~SockAddr() { } + virtual ~SockAddr() = default; virtual SockAddr *copy() const = 0;