X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/76d4afa3496d7710e7548b6bca27473db7c9308c..7afbddc7bce5654b4b49095f75066b13c166fb14:/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());