]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/mpl/remove_if.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
1573e4fd6baffd3699be77f0316093fab410763a
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / remove_if.hpp
1 \r
2 #ifndef BOOST_MPL_REMOVE_IF_HPP_INCLUDED\r
3 #define BOOST_MPL_REMOVE_IF_HPP_INCLUDED\r
4 \r
5 // Copyright Aleksey Gurtovoy 2000-2004\r
6 // Copyright David Abrahams 2003-2004\r
7 //\r
8 // Distributed under the Boost Software License, Version 1.0. \r
9 // (See accompanying file LICENSE_1_0.txt or copy at \r
10 // http://www.boost.org/LICENSE_1_0.txt)\r
11 //\r
12 // See http://www.boost.org/libs/mpl for documentation.\r
13 \r
14 // $Id: remove_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $\r
15 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $\r
16 // $Revision: 49267 $\r
17 \r
18 #include <boost/mpl/fold.hpp>\r
19 #include <boost/mpl/reverse_fold.hpp>\r
20 #include <boost/mpl/eval_if.hpp>\r
21 #include <boost/mpl/identity.hpp>\r
22 #include <boost/mpl/protect.hpp>\r
23 #include <boost/mpl/lambda.hpp>\r
24 #include <boost/mpl/apply.hpp>\r
25 #include <boost/mpl/aux_/inserter_algorithm.hpp>\r
26 \r
27 namespace boost { namespace mpl {\r
28 \r
29 namespace aux {\r
30 \r
31 template< typename Pred, typename InsertOp > struct remove_if_helper\r
32 {\r
33     template< typename Sequence, typename U > struct apply\r
34     {\r
35         typedef typename eval_if<\r
36               typename apply1<Pred,U>::type\r
37             , identity<Sequence>\r
38             , apply2<InsertOp,Sequence,U>\r
39             >::type type;\r
40     };\r
41 };\r
42 \r
43 template<\r
44       typename Sequence\r
45     , typename Predicate\r
46     , typename Inserter\r
47     >\r
48 struct remove_if_impl\r
49     : fold<\r
50           Sequence\r
51         , typename Inserter::state\r
52         , protect< aux::remove_if_helper<\r
53               typename lambda<Predicate>::type\r
54             , typename Inserter::operation\r
55             > >\r
56         >\r
57 {\r
58 };\r
59 \r
60 template<\r
61       typename Sequence\r
62     , typename Predicate\r
63     , typename Inserter\r
64     >\r
65 struct reverse_remove_if_impl\r
66     : reverse_fold<\r
67           Sequence\r
68         , typename Inserter::state\r
69         , protect< aux::remove_if_helper<\r
70               typename lambda<Predicate>::type\r
71             , typename Inserter::operation\r
72             > >\r
73         >\r
74 {\r
75 };\r
76 \r
77 } // namespace aux\r
78 \r
79 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if)\r
80 \r
81 }}\r
82 \r
83 #endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED\r