X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/39724c19e7cb170379c27ca126add0b57652ee96..8996be78fd84b1a3e10a2b7e66b264e28b524ebd:/loba_makhoul.cpp diff --git a/loba_makhoul.cpp b/loba_makhoul.cpp index 2fca60b..dcce7b7 100644 --- a/loba_makhoul.cpp +++ b/loba_makhoul.cpp @@ -10,6 +10,7 @@ void loba_makhoul::load_balance() { using std::tr1::bind; using std::tr1::placeholders::_1; + using std::tr1::placeholders::_2; pneigh_sort_by_load(std::less()); @@ -17,9 +18,10 @@ void loba_makhoul::load_balance() // find limit between least loaded neighbors, and more loaded ones pneigh_type::iterator bound = - std::find_if(pneigh.begin(), pneigh.end(), - bind(std::less_equal(), - get_load(), bind(&neighbor::get_load, _1))); + std::lower_bound(pneigh.begin(), pneigh.end(), + get_load(), + bind(std::less(), + bind(&neighbor::get_load, _1), _2)); // compute load differences std::vector delta(bound - pneigh.begin());