remove \r
[extl.git] / extl / algorithm / find.h
blob1f9681208d407afa4b736e62e31e92aea0a8a733
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: find.h
4 * Created: 08.07.01
5 * Updated: 09.01.26
7 * Brief: The find functions
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 #ifndef EXTL_ALGORITHM_FIND_H
14 #define EXTL_ALGORITHM_FIND_H
16 /*!\file find.h
17 * \brief The find functions
19 #ifndef __cplusplus
20 # error find.h need be supported by c++.
21 #endif
23 /* ///////////////////////////////////////////////////////////////////////
24 * Includes
26 #include "prefix.h"
27 #include "std/algorithm.h"
28 #include "detail/container_traits.h"
29 /* ///////////////////////////////////////////////////////////////////////
30 * ::extl namespace
32 EXTL_BEGIN_NAMESPACE
34 /*!xtl_find
36 * \ingroup extl_group_algorithm
38 template<typename_param_k InIt, typename_param_k Val>
39 EXTL_INLINE InIt xtl_find(InIt first, InIt last, Val const& value)
41 return std_find(first, last, value);
43 /*!xtl_find_if
45 * \ingroup extl_group_algorithm
47 template<typename_param_k InIt, typename_param_k Pr>
48 EXTL_INLINE InIt xtl_find_if(InIt first, InIt last, Pr pred)
50 return std_find_if(first, last, pred);
53 /*!find_all
55 * \ingroup extl_group_algorithm
57 template<typename_param_k C, typename_param_k Val>
58 EXTL_INLINE typename_type_ret_k EXTL_NS_DETAIL(container_traits)<C>::
59 const_iterator find_all(C const& container, Val const& value)
61 return xtl_find(container.begin(), container.end(), value);
63 /*!rfind_all
65 * \ingroup extl_group_algorithm
67 template<typename_param_k C, typename_param_k Val>
68 EXTL_INLINE typename_type_ret_k EXTL_NS_DETAIL(container_traits)<C>::
69 const_reverse_iterator rfind_all(C const& container, Val const& value)
71 return xtl_find(container.rbegin(), container.rend(), value);
73 /*!find_all_if
75 * \ingroup extl_group_algorithm
77 template<typename_param_k C, typename_param_k Pr>
78 EXTL_INLINE typename_type_ret_k EXTL_NS_DETAIL(container_traits)<C>::
79 const_iterator find_all_if(C const& container, Pr pred)
81 return xtl_find_if(container.begin(), container.end(), pred);
83 /*!rfind_all_if
85 * \ingroup extl_group_algorithm
87 template<typename_param_k C, typename_param_k Pr>
88 EXTL_INLINE typename_type_ret_k EXTL_NS_DETAIL(container_traits)<C>::
89 const_reverse_iterator rfind_all_if(C const& container, Pr pred)
91 return xtl_find_if(container.rbegin(), container.rend(), pred);
94 /* ///////////////////////////////////////////////////////////////////////
95 * ::extl namespace
97 EXTL_END_NAMESPACE
99 /* //////////////////////////////////////////////////////////////////// */
100 #endif /* EXTL_ALGORITHM_FIND_H */
101 /* //////////////////////////////////////////////////////////////////// */