1 #ifndef MSP_CORE_ALGORITHM_H_
2 #define MSP_CORE_ALGORITHM_H_
8 template<typename Container, typename T>
9 inline typename Container::iterator find(Container &cont, const T &value)
11 return std::find(cont.begin(), cont.end(), value);
14 template<typename Container, typename T>
15 inline typename Container::const_iterator find(const Container &cont, const T &value)
17 return std::find(cont.begin(), cont.end(), value);
20 template<typename Container, typename Predicate>
21 inline typename Container::iterator find_if(Container &cont, Predicate pred)
23 return std::find_if(cont.begin(), cont.end(), pred);
26 template<typename Container, typename Predicate>
27 inline typename Container::const_iterator find_if(const Container &cont, Predicate pred)
29 return std::find_if(cont.begin(), cont.end(), pred);
32 template<typename Container>
33 inline void sort(Container &cont)
35 std::sort(cont.begin(), cont.end());
38 template<typename Container, typename Predicate>
39 inline void sort(Container &cont, Predicate pred)
41 std::sort(cont.begin(), cont.end(), pred);
44 template<typename Container>
45 inline void stable_sort(Container &cont)
47 std::stable_sort(cont.begin(), cont.end());
50 template<typename Container, typename Predicate>
51 inline void stable_sort(Container &cont, Predicate pred)
53 std::stable_sort(cont.begin(), cont.end(), pred);