Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use rule-of-three, and hope to please sonar without breaking clang13 builds.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 15 Apr 2021 07:43:35 +0000 (09:43 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 15 Apr 2021 07:55:43 +0000 (09:55 +0200)
examples/cpp/dht-kademlia/routing_table.hpp
src/kernel/lmm/maxmin.hpp

index dff5954..4746e20 100644 (file)
@@ -19,6 +19,10 @@ public:
   std::deque<unsigned int> nodes_; // Nodes in the bucket.
   unsigned int getId() const { return id_; }
   explicit Bucket(unsigned int id) : id_(id) {}
+  // Use rule-of-three, and implicitely disable the move constructor which cannot be 'noexcept' (as required by C++ Core
+  // Guidelines), due to the std::deque member.
+  Bucket(const Bucket&) = default;
+  ~Bucket()             = default;
 };
 
 /* Node routing table */
index 3a140f2..2ad066c 100644 (file)
@@ -143,9 +143,11 @@ namespace lmm {
  */
 class XBT_PUBLIC Element {
 public:
+  // Use rule-of-three, and implicitely disable the move constructor which should be 'noexcept' according to C++ Core
+  // Guidelines.
   Element()               = default;
   Element(const Element&) = default;
-  Element(Element&& that) noexcept : Element(that) {}
+  ~Element()              = default;
 
   int get_concurrency() const;
   void decrease_concurrency();