remove \r
[extl.git] / extl / algorithm / for.h
blob4726a06b1417fc27f69d6ae6896062b8ef3f82d6
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: for.h
4 * Created: 09.01.26
5 * Updated: 09.01.26
7 * Brief: The for algorithms
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
13 #ifndef EXTL_ALGORITHM_FOR_H
14 #define EXTL_ALGORITHM_FOR_H
16 /*!\file for.h
17 * \brief The for algorithms
19 #ifndef __cplusplus
20 # error for.h need be supported by c++.
21 #endif
23 /* ///////////////////////////////////////////////////////////////////////
24 * Includes
26 #include "prefix.h"
27 #include "std/algorithm.h"
29 /* ///////////////////////////////////////////////////////////////////////
30 * ::extl namespace
32 EXTL_BEGIN_NAMESPACE
34 /*!xtl_foreach
36 * \ingroup extl_group_algorithm
38 template<typename_param_k InIt, typename_param_k Pr>
39 EXTL_INLINE Pr xtl_foreach(InIt first, InIt last, Pr pred)
41 return std_foreach(first, last, pred);
44 /*!for_all
46 * \ingroup extl_group_algorithm
48 template<typename_param_k Ctr, typename_param_k Pr>
49 EXTL_INLINE Pr for_all(Ctr& container, Pr pred)
51 return xtl_foreach(container.begin(), container.end(), pred);
54 /*!rfor_all
56 * \ingroup extl_group_algorithm
58 template<typename_param_k Ctr, typename_param_k Pr>
59 EXTL_INLINE Pr rfor_all(Ctr& container, Pr pred)
61 return xtl_foreach(container.rbegin(), container.rend(), pred);
63 /* ///////////////////////////////////////////////////////////////////////
64 * ::extl namespace
66 EXTL_END_NAMESPACE
68 /* //////////////////////////////////////////////////////////////////// */
69 #endif /* EXTL_ALGORITHM_FOR_H */
70 /* //////////////////////////////////////////////////////////////////// */