Clean-ups and fixes to compile with more warnings enabled and with g++.
[invirt/third/libt4.git] / paxos.cc
index ab60302..4bba25d 100644 (file)
--- a/paxos.cc
+++ b/paxos.cc
@@ -1,13 +1,15 @@
 #include "paxos.h"
 #include "handle.h"
 
+paxos_change::~paxos_change() {}
+
 bool isamember(const node_t & m, const nodes_t & nodes) {
     return find(nodes.begin(), nodes.end(), m) != nodes.end();
 }
 
 // check if l2 contains a majority of the elements of l1
-bool majority(const nodes_t &l1, const nodes_t &l2) {
-    auto overlap = (size_t)count_if(l1.begin(), l1.end(), bind(isamember, _1, l2));
+bool majority(const nodes_t & l1, const nodes_t & l2) {
+    auto overlap = (size_t)count_if(l1.begin(), l1.end(), std::bind(isamember, _1, l2));
     return overlap >= (l1.size() >> 1) + 1;
 }