Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Show how to programatically attach a state profile to an XML host in the relevant...
[simgrid.git] / examples / cpp / dht-kademlia / routing_table.hpp
index 9756edfc7e958df8edcf637fa540e7181038a697..4746e2021b9bdc499675e9e56ef6b5bfd9b26147 100644 (file)
@@ -14,11 +14,15 @@ namespace kademlia {
 
 /* Routing table bucket */
 class Bucket {
-  unsigned int id_; // bucket id
 public:
+  const unsigned int id_;          // bucket id
   std::deque<unsigned int> nodes_; // Nodes in the bucket.
   unsigned int getId() const { return id_; }
-  explicit Bucket(unsigned int id) noexcept : id_(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 */