X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Falgorithm.h;h=804db7b9d146905ae77cef973c8feae0233511fb;hp=63d1cf4cce7d33e45a6cda0355e0a536b778b964;hb=fa87d901ba9fa075e51637608902b7fbdd71f896;hpb=9d202f81f7080335b59ad1a5ab1d034634052a65 diff --git a/source/core/algorithm.h b/source/core/algorithm.h index 63d1cf4..804db7b 100644 --- a/source/core/algorithm.h +++ b/source/core/algorithm.h @@ -29,6 +29,54 @@ inline typename Container::const_iterator find_if(const Container &cont, Predica return std::find_if(cont.begin(), cont.end(), pred); } +template +inline typename Container::iterator lower_bound(Container &cont, const T &value) +{ + return std::lower_bound(cont.begin(), cont.end(), value); +} + +template +inline typename Container::const_iterator lower_bound(const Container &cont, const T &value) +{ + return std::lower_bound(cont.begin(), cont.end(), value); +} + +template +inline typename Container::iterator lower_bound(Container &cont, const T &value, Predicate pred) +{ + return std::lower_bound(cont.begin(), cont.end(), value, pred); +} + +template +inline typename Container::const_iterator lower_bound(const Container &cont, const T &value, Predicate pred) +{ + return std::lower_bound(cont.begin(), cont.end(), value, pred); +} + +template +inline typename Container::iterator upper_bound(Container &cont, const T &value) +{ + return std::upper_bound(cont.begin(), cont.end(), value); +} + +template +inline typename Container::const_iterator upper_bound(const Container &cont, const T &value) +{ + return std::upper_bound(cont.begin(), cont.end(), value); +} + +template +inline typename Container::iterator upper_bound(Container &cont, const T &value, Predicate pred) +{ + return std::upper_bound(cont.begin(), cont.end(), value, pred); +} + +template +inline typename Container::const_iterator upper_bound(const Container &cont, const T &value, Predicate pred) +{ + return std::upper_bound(cont.begin(), cont.end(), value, pred); +} + template inline void sort(Container &cont) {