]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy: use equals default
authorRosen Penev <rosenp@gmail.com>
Mon, 4 Dec 2023 03:00:27 +0000 (19:00 -0800)
committerRosen Penev <rosenp@gmail.com>
Tue, 9 Jan 2024 00:09:26 +0000 (16:09 -0800)
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
41 files changed:
modules/bindbackend/bindbackend2.hh
modules/geoipbackend/geoipinterface-dat.cc
modules/geoipbackend/geoipinterface.hh
modules/ldapbackend/ldapauthenticator.hh
modules/lmdbbackend/lmdbbackend.hh
modules/pipebackend/coprocess.hh
modules/pipebackend/pipebackend.cc
pdns/anadns.hh
pdns/auth-packetcache.hh
pdns/auth-querycache.hh
pdns/auth-secondarycommunicator.cc
pdns/auth-zonecache.hh
pdns/backends/gsql/gsqlbackend.cc
pdns/comment.hh
pdns/dnsbackend.hh
pdns/dnsname.hh
pdns/dnsparser.hh
pdns/dnsrecords.cc
pdns/dnsrecords.hh
pdns/dnssecinfra.hh
pdns/dnswasher.cc
pdns/ednscookies.hh
pdns/histogram.hh
pdns/iputils.hh
pdns/libssl.cc
pdns/lock.hh
pdns/lua-auth4.cc
pdns/lua-base4.cc
pdns/lua-record.cc
pdns/misc.hh
pdns/mplexer.hh
pdns/pkcs11signers.cc
pdns/pollmplexer.cc
pdns/sha.hh
pdns/stat_t.hh
pdns/statbag.cc
pdns/statnode.hh
pdns/tcpiohandler.cc
pdns/tcpiohandler.hh
pdns/tcpreceiver.cc
pdns/webserver.hh

index b61202267746f5375802860faec66167f8b8c1d8..14aff4835c6dfdb29c4e374271b2b3fa7405644b 100644 (file)
@@ -108,9 +108,7 @@ template <typename T>
 class LookButDontTouch
 {
 public:
-  LookButDontTouch()
-  {
-  }
+  LookButDontTouch() = default;
   LookButDontTouch(shared_ptr<T>&& records) :
     d_records(std::move(records))
   {
index 198e60f08ab770c364e0d91310909cc12bd3ac91..83cdebc72570b6b252d4792107322ce03ab7fbc8 100644 (file)
@@ -463,7 +463,7 @@ public:
     return false;
   }
 
-  ~GeoIPInterfaceDAT() {}
+  ~GeoIPInterfaceDAT() = default;
 
 private:
   unsigned int d_db_type;
index 3ac8d8bcf75f3bcf68cfc16a6c7eb50cf3033f6a..da745ada6189ef21e7370e7b50dc744ec4fa87ce 100644 (file)
@@ -62,7 +62,7 @@ public:
                                boost::optional<int>& alt, boost::optional<int>& prec)
     = 0;
 
-  virtual ~GeoIPInterface() {}
+  virtual ~GeoIPInterface() = default;
 
   static unique_ptr<GeoIPInterface> makeInterface(const string& dbStr);
 
index 160d250c0e7241dbce084657ccd953e17142541b..a1d05c77ededb0909daa591bc22f704719ab8566 100644 (file)
@@ -28,7 +28,7 @@
 class LdapAuthenticator
 {
 public:
-  virtual ~LdapAuthenticator() {}
+  virtual ~LdapAuthenticator() = default;
   virtual bool authenticate(LDAP* connection) = 0;
   virtual std::string getError() const = 0;
 };
index e75b564c55a6bd80c80d0ee0c895126381d1f266..b4c0c157c2190f03973de9fa0636be58a63ae6fc 100644 (file)
@@ -243,7 +243,7 @@ public:
   class LMDBResourceRecord : public DNSResourceRecord
   {
   public:
-    LMDBResourceRecord() {}
+    LMDBResourceRecord() = default;
     LMDBResourceRecord(const DNSResourceRecord& rr) :
       DNSResourceRecord(rr), ordername(false) {}
 
index 5fbf331935b94cb165022af0112d4b151e886342..0a0bbbf0929cb14a1b681675153f07371a82f1f1 100644 (file)
@@ -29,7 +29,7 @@
 class CoRemote
 {
 public:
-  virtual ~CoRemote() {}
+  virtual ~CoRemote() = default;
   virtual void sendReceive(const string& send, string& receive) = 0;
   virtual void receive(string& rcv) = 0;
   virtual void send(const string& send) = 0;
index d2f0c5db94f78ee6cea7560fb1c969472d85df6c..e79075a7f3845dc648498eb804ea6307291c7ba0 100644 (file)
@@ -53,9 +53,7 @@ CoWrapper::CoWrapper(const string& command, int timeout, int abiVersion)
   // I think
 }
 
-CoWrapper::~CoWrapper()
-{
-}
+CoWrapper::~CoWrapper() = default;
 
 void CoWrapper::launch()
 {
index 8b68db8488cb010a42ba5c432b0c05529ed9fdc2..ec028ea8c361c198a9d26435724b09dd28f915f0 100644 (file)
@@ -29,8 +29,7 @@
 
 struct QuestionIdentifier
 {
-  QuestionIdentifier() 
-  {}
+  QuestionIdentifier() = default;
 
   bool operator<(const QuestionIdentifier& rhs) const
   {
index efd11c0825743b64bbd2a3d2df67c6ebcf0ca1c0..0b22e6282556d15f63b10ccf4cff23b25b824e07 100644 (file)
@@ -110,10 +110,8 @@ private:
 
   struct MapCombo
   {
-    MapCombo() {
-    }
-    ~MapCombo() {
-    }
+    MapCombo() = default;
+    ~MapCombo() = default;
     MapCombo(const MapCombo&) = delete; 
     MapCombo& operator=(const MapCombo&) = delete;
 
index 54a46b879bb6e48af90a947b62963731d00c2822..b144b366700d42fa6caa0ccdf440e25ee1ac2bc7 100644 (file)
@@ -92,10 +92,8 @@ private:
 
   struct MapCombo
   {
-    MapCombo() {
-    }
-    ~MapCombo() {
-    }
+    MapCombo() = default;
+    ~MapCombo() = default;
     MapCombo(const MapCombo &) = delete; 
     MapCombo & operator=(const MapCombo &) = delete;
 
index 9b76a66526381ca93c9de150b3c86fb74ea2f205..fb0e73c7a8a9c8ae099a13460d2c88e63eaac777 100644 (file)
@@ -1042,10 +1042,6 @@ struct SecondarySenderReceiver
 
   map<uint32_t, Answer> d_freshness;
 
-  SecondarySenderReceiver()
-  {
-  }
-
   void deliverTimeout(const Identifier& /* i */)
   {
   }
index c5b052a5378fd1a038319bb03049db6b1fd86478..2a25cc4c8e25b779598ac1e93202c50b0040ced0 100644 (file)
@@ -66,8 +66,8 @@ private:
 
   struct MapCombo
   {
-    MapCombo() {}
-    ~MapCombo() {}
+    MapCombo() = default;
+    ~MapCombo() = default;
     MapCombo(const MapCombo&) = delete;
     MapCombo& operator=(const MapCombo&) = delete;
 
index fcc5cc85d4351442cd588279fc7b7fe47dc3b36e..0cb0c13f691583946eaaf265464392d84bc9a0be 100644 (file)
@@ -2327,6 +2327,5 @@ void GSQLBackend::extractComment(SSqlStatement::row_t& row, Comment& comment)
   comment.content = std::move(row[5]);
 }
 
-SSqlStatement::~SSqlStatement() {
 // make sure vtable won't break
-}
+SSqlStatement::~SSqlStatement() = default;
index 6854c094474ec5c92c755d672714e54677d509b4..1608cffec816fd1a5387044fecb179472f8ce717 100644 (file)
@@ -28,7 +28,7 @@ class Comment
 {
 public:
   Comment() : modified_at(0), domain_id(0)  {};
-  ~Comment() {};
+  ~Comment() = default;
 
   // data
   DNSName qname; //!< the name of the associated RRset, for example: www.powerdns.com
index a2ee00b41c9fc543b305bafd705376f57bf82b03..625a4780723888841677ec38a7406a8b9d818c3a 100644 (file)
@@ -165,7 +165,7 @@ public:
   */
   virtual bool list(const DNSName &target, int domain_id, bool include_disabled=false)=0;
 
-  virtual ~DNSBackend(){};
+  virtual ~DNSBackend() = default;
 
   //! fills the soadata struct with the SOA details. Returns false if there is no SOA.
   virtual bool getSOA(const DNSName &name, SOAData &soadata);
@@ -475,7 +475,7 @@ class BackendFactory
 {
 public:
   BackendFactory(const string &name) : d_name(name) {}
-  virtual ~BackendFactory(){}
+  virtual ~BackendFactory() = default;
   virtual DNSBackend *make(const string &suffix)=0;
   virtual DNSBackend *makeMetadataOnly(const string &suffix)
   {
index 29c8325c5d602bbf17b0151f2c9b7c1f63a210a1..101d17464c6e68a49e13bfba966179aced1ff0a7 100644 (file)
@@ -80,7 +80,7 @@ class DNSName
 public:
   static const size_t s_maxDNSNameLength = 255;
 
-  DNSName()  {}          //!< Constructs an *empty* DNSName, NOT the root!
+  DNSName() = default; //!< Constructs an *empty* DNSName, NOT the root!
   // Work around assertion in some boost versions that do not like self-assignment of boost::container::string
   DNSName& operator=(const DNSName& rhs)
   {
@@ -561,8 +561,7 @@ private:
 struct SuffixMatchNode
 {
   public:
-    SuffixMatchNode()
-    {}
+    SuffixMatchNode() = default;
     SuffixMatchTree<bool> d_tree;
 
     void add(const DNSName& dnsname)
index dd87f252643c9923baa6ee08700f409f946213f1..20ce6396beb87d5dccc6c4750649f56ec904a390 100644 (file)
@@ -198,7 +198,7 @@ public:
   static string upgradeContent(const DNSName& qname, const QType& qtype, const string& content);
 
   virtual std::string getZoneRepresentation(bool noDot=false) const = 0;
-  virtual ~DNSRecordContent() {}
+  virtual ~DNSRecordContent() = default;
   virtual void toPacket(DNSPacketWriter& pw) const = 0;
   // returns the wire format of the content, possibly including compressed pointers pointing to the owner name (unless canonic or lowerCase are set)
   string serialize(const DNSName& qname, bool canonic=false, bool lowerCase=false) const
index 1cf4c2c82845799a98919dbf9d758089de35cacd..6b0079247ebc6682d6e5f42babaf6319ae12a7b6 100644 (file)
@@ -360,7 +360,7 @@ boilerplate_conv(SMIMEA,
                  conv.xfrHexBlob(d_cert, true);
                  )
 
-DSRecordContent::DSRecordContent() {}
+DSRecordContent::DSRecordContent() = default;
 boilerplate_conv(DS,
                  conv.xfr16BitInt(d_tag);
                  conv.xfr8BitInt(d_algorithm);
@@ -368,7 +368,7 @@ boilerplate_conv(DS,
                  conv.xfrHexBlob(d_digest, true); // keep reading across spaces
                  )
 
-CDSRecordContent::CDSRecordContent() {}
+CDSRecordContent::CDSRecordContent() = default;
 boilerplate_conv(CDS,
                  conv.xfr16BitInt(d_tag);
                  conv.xfr8BitInt(d_algorithm);
@@ -376,7 +376,7 @@ boilerplate_conv(CDS,
                  conv.xfrHexBlob(d_digest, true); // keep reading across spaces
                  )
 
-DLVRecordContent::DLVRecordContent() {}
+DLVRecordContent::DLVRecordContent() = default;
 boilerplate_conv(DLV,
                  conv.xfr16BitInt(d_tag);
                  conv.xfr8BitInt(d_algorithm);
@@ -403,7 +403,7 @@ boilerplate_conv(RRSIG,
                  conv.xfrBlob(d_signature);
                  )
 
-RRSIGRecordContent::RRSIGRecordContent() {}
+RRSIGRecordContent::RRSIGRecordContent() = default;
 
 boilerplate_conv(DNSKEY,
                  conv.xfr16BitInt(d_flags);
@@ -411,7 +411,7 @@ boilerplate_conv(DNSKEY,
                  conv.xfr8BitInt(d_algorithm);
                  conv.xfrBlob(d_key);
                  )
-DNSKEYRecordContent::DNSKEYRecordContent() {}
+DNSKEYRecordContent::DNSKEYRecordContent() = default;
 
 boilerplate_conv(CDNSKEY,
                  conv.xfr16BitInt(d_flags);
@@ -419,7 +419,7 @@ boilerplate_conv(CDNSKEY,
                  conv.xfr8BitInt(d_algorithm);
                  conv.xfrBlob(d_key);
                  )
-CDNSKEYRecordContent::CDNSKEYRecordContent() {}
+CDNSKEYRecordContent::CDNSKEYRecordContent() = default;
 
 boilerplate_conv(RKEY,
                  conv.xfr16BitInt(d_flags);
@@ -427,7 +427,7 @@ boilerplate_conv(RKEY,
                  conv.xfr8BitInt(d_algorithm);
                  conv.xfrBlob(d_key);
                  )
-RKEYRecordContent::RKEYRecordContent() {}
+RKEYRecordContent::RKEYRecordContent() = default;
 
 boilerplate_conv(NID,
                  conv.xfr16BitInt(d_preference);
index dc2a1ce60048c0658f054702213e338c097f0b1c..1692d8795ad196e8acfec6b257e86ef3aee9e91c 100644 (file)
@@ -176,7 +176,7 @@ class TSIGRecordContent : public DNSRecordContent
 {
 public:
   includeboilerplate(TSIG)
-  TSIGRecordContent() {}
+  TSIGRecordContent() = default;
 
   uint16_t d_origID{0};
   uint16_t d_fudge{0};
@@ -334,7 +334,7 @@ private:
 class OPTRecordContent : public DNSRecordContent
 {
 public:
-  OPTRecordContent(){}
+  OPTRecordContent() = default;
   includeboilerplate(OPT)
   void getData(vector<pair<uint16_t, string> > &opts) const;
 private:
@@ -701,8 +701,7 @@ class NSECRecordContent : public DNSRecordContent
 {
 public:
   static void report(void);
-  NSECRecordContent()
-  {}
+  NSECRecordContent() = default;
   NSECRecordContent(const string& content, const DNSName& zone=DNSName());
 
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
@@ -739,8 +738,7 @@ class NSEC3RecordContent : public DNSRecordContent
 {
 public:
   static void report(void);
-  NSEC3RecordContent()
-  {}
+  NSEC3RecordContent() = default;
   NSEC3RecordContent(const string& content, const DNSName& zone=DNSName());
 
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
@@ -786,8 +784,7 @@ class CSYNCRecordContent : public DNSRecordContent
 {
 public:
   static void report(void);
-  CSYNCRecordContent()
-  {}
+  CSYNCRecordContent() = default;
   CSYNCRecordContent(const string& content, const DNSName& zone=DNSName());
 
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
@@ -815,8 +812,7 @@ class NSEC3PARAMRecordContent : public DNSRecordContent
 {
 public:
   static void report(void);
-  NSEC3PARAMRecordContent()
-  {}
+  NSEC3PARAMRecordContent() = default;
   NSEC3PARAMRecordContent(const string& content, const DNSName& zone=DNSName());
 
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
@@ -840,8 +836,7 @@ class LOCRecordContent : public DNSRecordContent
 {
 public:
   static void report(void);
-  LOCRecordContent()
-  {}
+  LOCRecordContent() = default;
   LOCRecordContent(const string& content, const string& zone="");
 
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
@@ -903,7 +898,7 @@ private:
 class EUI48RecordContent : public DNSRecordContent
 {
 public:
-  EUI48RecordContent() {};
+  EUI48RecordContent() = default;
   static void report(void);
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
   static std::shared_ptr<DNSRecordContent> make(const string& zone); // FIXME400: DNSName& zone?
@@ -918,7 +913,7 @@ private:
 class EUI64RecordContent : public DNSRecordContent
 {
 public:
-  EUI64RecordContent() {};
+  EUI64RecordContent() = default;
   static void report(void);
   static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
   static std::shared_ptr<DNSRecordContent> make(const string& zone); // FIXME400: DNSName& zone?
@@ -945,7 +940,7 @@ typedef struct s_APLRDataElement {
 class APLRecordContent : public DNSRecordContent
 {
 public:
-  APLRecordContent() {};
+  APLRecordContent() = default;
   includeboilerplate(APL)
 private:
   std::vector<APLRDataElement> aplrdata;
index 0ddb54eae6dc9a1e2f6f82dffab88ba7bc0aaa4f..617a9c7df03fc97be6e785d6299a8ce71cf18ed1 100644 (file)
@@ -36,7 +36,7 @@ class DNSCryptoKeyEngine
 {
   public:
     explicit DNSCryptoKeyEngine(unsigned int algorithm) : d_algorithm(algorithm) {}
-    virtual ~DNSCryptoKeyEngine() {};
+    virtual ~DNSCryptoKeyEngine() = default;
     [[nodiscard]] virtual string getName() const = 0;
 
     using stormap_t = std::map<std::string, std::string>;
index f370ce36aee41105e8c83bb7d0779f7a6b2294f4..a155305324e752e0b7cec2d6d5e857e828f09f1b 100644 (file)
@@ -57,9 +57,7 @@ po::variables_map g_vm;
 class IPObfuscator
 {
 public:
-  virtual ~IPObfuscator()
-  {
-  }
+  virtual ~IPObfuscator() = default;
   virtual uint32_t obf4(uint32_t orig)=0;
   virtual struct in6_addr obf6(const struct in6_addr& orig)=0;
 };
@@ -71,9 +69,6 @@ public:
   {
   }
 
-  ~IPSeqObfuscator()
-  {}
-
   static std::unique_ptr<IPObfuscator> make()
   {
     return std::make_unique<IPSeqObfuscator>();
@@ -132,8 +127,6 @@ public:
     }
   }
 
-  ~IPCipherObfuscator()
-  {}
   static std::unique_ptr<IPObfuscator> make(std::string key, bool decrypt)
   {
     return std::make_unique<IPCipherObfuscator>(key, decrypt);
index 7eff3c63fe99fea2147ae604f2b10b5e5133969e..47800446f318d5a543fb4085b3a0b0ecb23b3e24 100644 (file)
@@ -28,7 +28,7 @@ struct EDNSCookiesOpt
   static const size_t EDNSCookieSecretSize = 32;
   static const size_t EDNSCookieOptSize = 24;
 
-  EDNSCookiesOpt(){};
+  EDNSCookiesOpt() = default;
   EDNSCookiesOpt(const std::string& option);
   EDNSCookiesOpt(const char* option, unsigned int len);
 
index 4c50789f2871e583a4ef7674e6f16de32f0f922a..4b9263bc8248e34bdf38a1bd95b3a098af5e36ce 100644 (file)
@@ -55,7 +55,7 @@ struct Bucket
 struct AtomicBucket
 {
   // We need the constructors in this case, since atomics have a disabled copy constructor.
-  AtomicBucket() {}
+  AtomicBucket() = default;
   AtomicBucket(std::string name, uint64_t boundary, uint64_t val) :
     d_name(std::move(name)), d_boundary(boundary), d_count(val) {}
   AtomicBucket(const AtomicBucket& rhs) :
index ade4c82a301888e0756960b13c63b20e4a73c65f..ee2f8f04f2d19d69d0ed25291c4aa1b75c84d616 100644 (file)
@@ -1358,8 +1358,7 @@ private:
 class NetmaskGroup
 {
 public:
-  NetmaskGroup() noexcept {
-  }
+  NetmaskGroup() noexcept = default;
 
   //! If this IP address is matched by any of the classes within
 
index fa37b3e62c6ebb5320a26d4b32298b2ebe9c8822..ca35757f0c2ede7a21c55b00dd78eeca5de9110a 100644 (file)
@@ -626,9 +626,7 @@ OpenSSLTLSTicketKeysRing::OpenSSLTLSTicketKeysRing(size_t capacity)
   d_ticketKeys.write_lock()->set_capacity(capacity);
 }
 
-OpenSSLTLSTicketKeysRing::~OpenSSLTLSTicketKeysRing()
-{
-}
+OpenSSLTLSTicketKeysRing::~OpenSSLTLSTicketKeysRing() = default;
 
 void OpenSSLTLSTicketKeysRing::addKey(std::shared_ptr<OpenSSLTLSTicketKey>&& newKey)
 {
index d17a924cbebb515979042aa82265a97805808668..411af5b19bcb1ae44abb2218a95dd9888069270b 100644 (file)
@@ -81,9 +81,7 @@
 class ReadWriteLock
 {
 public:
-  ReadWriteLock()
-  {
-  }
+  ReadWriteLock() = default;
 
   ReadWriteLock(const ReadWriteLock& rhs) = delete;
   ReadWriteLock(ReadWriteLock&& rhs) = delete;
@@ -275,9 +273,7 @@ public:
   {
   }
 
-  explicit LockGuarded()
-  {
-  }
+  explicit LockGuarded() = default;
 
   LockGuardedTryHolder<T> try_lock()
   {
@@ -423,9 +419,7 @@ public:
   {
   }
 
-  explicit SharedLockGuarded()
-  {
-  }
+  explicit SharedLockGuarded() = default;
 
   SharedLockGuardedTryHolder<T> try_write_lock()
   {
index 0a2eb571a7f59f33916587182eaf57102468b5f9..3efd2d7be7d5c82695727184b517a2b966fb4539 100644 (file)
@@ -170,4 +170,4 @@ std::unique_ptr<DNSPacket> AuthLua4::prequery(const DNSPacket& q) {
   return nullptr;
 }
 
-AuthLua4::~AuthLua4() { }
+AuthLua4::~AuthLua4() = default;
index b150be8328689f3c946a0e0a705d9f56c016be4d..3984fe62e974583b2a7e8b6d85703d119ee0c3bc 100644 (file)
@@ -15,8 +15,7 @@
 #include "ext/luawrapper/include/LuaContext.hpp"
 #include "dns_random.hh"
 
-BaseLua4::BaseLua4() {
-}
+BaseLua4::BaseLua4() = default;
 
 void BaseLua4::loadFile(const std::string& fname)
 {
@@ -296,4 +295,4 @@ void BaseLua4::loadStream(std::istream &is) {
   postLoad();
 }
 
-BaseLua4::~BaseLua4() { }
+BaseLua4::~BaseLua4() = default;
index c3358044abb9689797cdc9f75061f70cacc900cb..4a9b8861ae0a1aab24690c1a69512d2f096ad462 100644 (file)
@@ -80,9 +80,7 @@ public:
   {
     d_checkerThreadStarted.clear();
   }
-  ~IsUpOracle()
-  {
-  }
+  ~IsUpOracle() = default;
   bool isUp(const ComboAddress& remote, const opts_t& opts);
   bool isUp(const ComboAddress& remote, const std::string& url, const opts_t& opts);
   bool isUp(const CheckDesc& cd);
index 740c32b816d86cd23805b8fe86e296e2fe347dc0..209de32e060d23b9cdf91ca684be95f6feee9757 100644 (file)
@@ -131,9 +131,8 @@ stringtok (Container &container, string const &in,
 
 template<typename T> bool rfc1982LessThan(T a, T b)
 {
-  static_assert(std::is_unsigned<T>::value, "rfc1982LessThan only works for unsigned types");
-  typedef typename std::make_signed<T>::type signed_t;
-  return static_cast<signed_t>(a - b) < 0;
+  static_assert(std::is_unsigned_v<T>, "rfc1982LessThan only works for unsigned types");
+  return std::make_signed_t<T>(a - b) < 0;
 }
 
 // fills container with ranges, so {posbegin,posend}
@@ -620,7 +619,7 @@ T valueOrEmpty(const P val) {
 
 // I'm not very OCD, but I appreciate loglines like "processing 1 delta", "processing 2 deltas" :-)
 template <typename Integer,
-typename std::enable_if_t<std::is_integral<Integer>::value, bool> = true>
+typename std::enable_if_t<std::is_integral_v<Integer>, bool> = true>
 const char* addS(Integer siz, const char* singular = "", const char *plural = "s")
 {
   if (siz == 1) {
@@ -630,7 +629,7 @@ const char* addS(Integer siz, const char* singular = "", const char *plural = "s
 }
 
 template <typename C,
-typename std::enable_if_t<std::is_class<C>::value, bool> = true>
+typename std::enable_if_t<std::is_class_v<C>, bool> = true>
 const char* addS(const C& c, const char* singular = "", const char *plural = "s")
 {
   return addS(c.size(), singular, plural);
index 33f5066131de1f0fe3cfc4b942889a5978d4f372..0fab1075883f23b0bdd86d085eb05915482921a3 100644 (file)
@@ -73,8 +73,7 @@ public:
   FDMultiplexer() :
     d_inrun(false)
   {}
-  virtual ~FDMultiplexer()
-  {}
+  virtual ~FDMultiplexer() = default;
 
   // The maximum number of events processed in a single run, not the maximum of watched descriptors
   static constexpr unsigned int s_maxevents = 1024;
index db8c78702a94abbe9cf7df9e4914e28c0c17c5e5..d7ecd3f5e2456fa7bae85cfee9754a73309ad96c 100644 (file)
@@ -780,8 +780,7 @@ Pkcs11Token::Pkcs11Token(const std::shared_ptr<LockGuarded<Pkcs11Slot>>& slot, c
   if (this->d_slot->lock()->LoggedIn()) LoadAttributes();
 }
 
-Pkcs11Token::~Pkcs11Token() {
-}
+Pkcs11Token::~Pkcs11Token() = default;
 
 bool PKCS11ModuleSlotLogin(const std::string& module, const string& tokenId, const std::string& pin)
 {
@@ -791,7 +790,7 @@ bool PKCS11ModuleSlotLogin(const std::string& module, const string& tokenId, con
 }
 
 PKCS11DNSCryptoKeyEngine::PKCS11DNSCryptoKeyEngine(unsigned int algorithm): DNSCryptoKeyEngine(algorithm) {}
-PKCS11DNSCryptoKeyEngine::~PKCS11DNSCryptoKeyEngine() {}
+PKCS11DNSCryptoKeyEngine::~PKCS11DNSCryptoKeyEngine() = default;
 PKCS11DNSCryptoKeyEngine::PKCS11DNSCryptoKeyEngine(const PKCS11DNSCryptoKeyEngine& orig) : DNSCryptoKeyEngine(orig.d_algorithm) {}
 
 void PKCS11DNSCryptoKeyEngine::create(unsigned int bits) {
index 8d33123c3dd75fd036ed648716e9ed69e0c4718a..936c0c5088003b1d8e58ed23b0fb255c6277e49b 100644 (file)
@@ -30,9 +30,6 @@ class PollFDMultiplexer : public FDMultiplexer
 public:
   PollFDMultiplexer(unsigned int /* maxEventsHint */)
   {}
-  ~PollFDMultiplexer()
-  {
-  }
 
   int run(struct timeval* tv, int timeout = 500) override;
   void getAvailableFDs(std::vector<int>& fds, int timeout) override;
index e1c1e733cd83979167206c9d3093257a5b53e600..92e6d387be9f234b196ce860de0c7beced4fcaca 100644 (file)
@@ -88,10 +88,8 @@ public:
     }
   }
 
-  ~SHADigest()
-  {
-    // No free of md needed and mdctx is cleaned up by unique_ptr
-  }
+  // No free of md needed and mdctx is cleaned up by unique_ptr
+  ~SHADigest() = default;
 
   void process(const std::string& msg)
   {
index 389a62676bb700882a5df89e288d429d5d68191f..d339cec37d224a19b66619c38e490cd563509a71 100644 (file)
@@ -71,7 +71,7 @@ namespace pdns {
     }
 
   private:
-    typename std::aligned_storage<sizeof(base_t), CPU_LEVEL1_DCACHE_LINESIZE>::type counter;
+    typename std::aligned_storage_t<sizeof(base_t), CPU_LEVEL1_DCACHE_LINESIZE> counter;
   };
 
   typedef stat_t_trait<uint64_t> stat_t;
index 46066d2ca076d1da360e249979decc54ca0371d7..99046c62eaaa9a945bc1651bb3bd1bb99c6ef367 100644 (file)
@@ -166,9 +166,7 @@ AtomicCounter *StatBag::getPointer(const string &key)
   return d_stats[key].get();
 }
 
-StatBag::~StatBag()
-{
-}
+StatBag::~StatBag() = default;
 
 template<typename T, typename Comp>
 StatRing<T,Comp>::StatRing(unsigned int size)
index 4f9590507e21bf0e13c2cf3bf97e8464454c575f..6748c3509c0afaa13e2a82b1eb6285fc1dc6be34 100644 (file)
@@ -30,10 +30,7 @@ public:
 
   struct Stat
   {
-    Stat()
-    {
-    }
-
+    Stat() {};
     uint64_t queries{0};
     uint64_t noerrors{0};
     uint64_t nxdomains{0};
index bb038e64c572560784343ed24f90521c74738e99..55f18554bd6be08bb2f557fafcfd3993088bce6a 100644 (file)
@@ -62,10 +62,6 @@ public:
   {
   }
 
-  virtual ~OpenSSLSession()
-  {
-  }
-
   std::unique_ptr<SSL_SESSION, void(*)(SSL_SESSION*)> getNative()
   {
     return std::move(d_sess);
index 3f68828163de3097c88f5c3c1c3407985f5d67c4..9e0dfdf5aa8d42a17634f40a8e6217f351f7c242 100644 (file)
@@ -15,15 +15,13 @@ enum class IOState : uint8_t { Done, NeedRead, NeedWrite, Async };
 class TLSSession
 {
 public:
-  virtual ~TLSSession()
-  {
-  }
+  virtual ~TLSSession() = default;
 };
 
 class TLSConnection
 {
 public:
-  virtual ~TLSConnection() { }
+  virtual ~TLSConnection() = default;
   virtual void doHandshake() = 0;
   virtual IOState tryConnect(bool fastOpen, const ComboAddress& remote) = 0;
   virtual void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) = 0;
@@ -75,7 +73,7 @@ public:
   {
     d_rotatingTicketsKey.clear();
   }
-  virtual ~TLSCtx() {}
+  virtual ~TLSCtx() = default;
   virtual std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) = 0;
   virtual std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, bool hostIsAddr, int socket, const struct timeval& timeout) = 0;
   virtual void rotateTicketsKey(time_t now) = 0;
index e1a6990c9aba790201b3f282b4f83cf32928ef4a..b84a6b9b4b4f2e8b08af67c74439dec30dc75d35 100644 (file)
@@ -1303,10 +1303,7 @@ int TCPNameserver::doIXFR(std::unique_ptr<DNSPacket>& q, int outsock)
   return doAXFR(q->qdomain, q, outsock);
 }
 
-TCPNameserver::~TCPNameserver()
-{
-}
-
+TCPNameserver::~TCPNameserver() = default;
 TCPNameserver::TCPNameserver()
 {
   d_maxTransactionsPerConn = ::arg().asNum("max-tcp-transactions-per-conn");
index 28d901dbd52df329d3be601f0bd4d48c98aaaf5b..49f38b9ab319ef605851bf1fc6fdc41d8ca2f921 100644 (file)
@@ -165,7 +165,7 @@ public:
     d_server_socket.bind(d_local);
     d_server_socket.listen();
   }
-  virtual ~Server() { };
+  virtual ~Server() = default;
 
   ComboAddress d_local;
 
@@ -181,7 +181,7 @@ class WebServer : public boost::noncopyable
 {
 public:
   WebServer(string listenaddress, int port);
-  virtual ~WebServer() { };
+  virtual ~WebServer() = default;
 
 #ifdef RECURSOR
   void setSLog(Logr::log_t log)