]> git.tdb.fi Git - libs/core.git/blob - source/core/algorithm.h
Mark the functions in algorithm.h as inline
[libs/core.git] / source / core / algorithm.h
1 #ifndef MSP_CORE_ALGORITHM_H_
2 #define MSP_CORE_ALGORITHM_H_
3
4 #include <algorithm>
5
6 namespace Msp {
7
8 template<typename Container, typename T>
9 inline typename Container::iterator find(Container &cont, const T &value)
10 {
11         return std::find(cont.begin(), cont.end(), value);
12 }
13
14 template<typename Container, typename T>
15 inline typename Container::const_iterator find(const Container &cont, const T &value)
16 {
17         return std::find(cont.begin(), cont.end(), value);
18 }
19
20 template<typename Container, typename Predicate>
21 inline typename Container::iterator find_if(Container &cont, Predicate pred)
22 {
23         return std::find_if(cont.begin(), cont.end(), pred);
24 }
25
26 template<typename Container, typename Predicate>
27 inline typename Container::const_iterator find_if(const Container &cont, Predicate pred)
28 {
29         return std::find_if(cont.begin(), cont.end(), pred);
30 }
31
32 } // namespace Msp
33
34 #endif