From e6f07a6fe45193fae96e381c164d42b150ae7330 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 28 Nov 2021 18:35:15 +0800 Subject: [PATCH] Use implicit copy-constructor generated by compiler This also suppresses the following clang warning: warning: definition of implicit copy assignment operator for 'Version' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy] --- src/base/bittorrent/infohash.h | 1 - src/base/digest32.h | 1 - src/base/utils/version.h | 9 ++------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/base/bittorrent/infohash.h b/src/base/bittorrent/infohash.h index 31fd0ee55..d7848a151 100644 --- a/src/base/bittorrent/infohash.h +++ b/src/base/bittorrent/infohash.h @@ -64,7 +64,6 @@ namespace BitTorrent #endif InfoHash() = default; - InfoHash(const InfoHash &other) = default; InfoHash(const WrappedType &nativeHash); bool isValid() const; diff --git a/src/base/digest32.h b/src/base/digest32.h index ece84af41..2241ef691 100644 --- a/src/base/digest32.h +++ b/src/base/digest32.h @@ -41,7 +41,6 @@ public: using UnderlyingType = lt::digest32; Digest32() = default; - Digest32(const Digest32 &other) = default; Digest32(const UnderlyingType &nativeDigest) : m_valid {true} diff --git a/src/base/utils/version.h b/src/base/utils/version.h index a03ea9155..12c7f75d1 100644 --- a/src/base/utils/version.h +++ b/src/base/utils/version.h @@ -48,12 +48,7 @@ namespace Utils typedef T ComponentType; typedef Version ThisType; - constexpr Version() - : m_components {{}} - { - } - - constexpr Version(const ThisType &other) = default; + constexpr Version() = default; template constexpr Version(Other ... components) @@ -187,7 +182,7 @@ namespace Utils { } - ComponentsArray m_components; + ComponentsArray m_components {{}}; }; template