X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Falgorithm.h;h=63d1cf4cce7d33e45a6cda0355e0a536b778b964;hp=69ec390908793a7e299cba81115b30c93e68cc79;hb=9d202f81f7080335b59ad1a5ab1d034634052a65;hpb=b584abc28a1a09190b555359fd3f2f406d9d6788;ds=sidebyside diff --git a/source/core/algorithm.h b/source/core/algorithm.h index 69ec390..63d1cf4 100644 --- a/source/core/algorithm.h +++ b/source/core/algorithm.h @@ -29,6 +29,30 @@ inline typename Container::const_iterator find_if(const Container &cont, Predica return std::find_if(cont.begin(), cont.end(), 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