X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Falgorithm.h;h=804db7b9d146905ae77cef973c8feae0233511fb;hb=229f0438383b1ab7d0de0f9ea9a9a2912363bdbc;hp=69ec390908793a7e299cba81115b30c93e68cc79;hpb=b584abc28a1a09190b555359fd3f2f406d9d6788;p=libs%2Fcore.git diff --git a/source/core/algorithm.h b/source/core/algorithm.h index 69ec390..804db7b 100644 --- a/source/core/algorithm.h +++ b/source/core/algorithm.h @@ -29,6 +29,78 @@ 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) +{ + std::sort(cont.begin(), cont.end()); +} + +template +inline void sort(Container &cont, Predicate pred) +{ + std::sort(cont.begin(), cont.end(), pred); +} + +template +inline void stable_sort(Container &cont) +{ + std::stable_sort(cont.begin(), cont.end()); +} + +template +inline void stable_sort(Container &cont, Predicate pred) +{ + std::stable_sort(cont.begin(), cont.end(), pred); +} + } // namespace Msp #endif