2 #ifndef BOOST_MPL_REMOVE_IF_HPP_INCLUDED
\r
3 #define BOOST_MPL_REMOVE_IF_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2000-2004
\r
6 // Copyright David Abrahams 2003-2004
\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
12 // See http://www.boost.org/libs/mpl for documentation.
\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
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
27 namespace boost { namespace mpl {
\r
31 template< typename Pred, typename InsertOp > struct remove_if_helper
\r
33 template< typename Sequence, typename U > struct apply
\r
35 typedef typename eval_if<
\r
36 typename apply1<Pred,U>::type
\r
37 , identity<Sequence>
\r
38 , apply2<InsertOp,Sequence,U>
\r
45 , typename Predicate
\r
48 struct remove_if_impl
\r
51 , typename Inserter::state
\r
52 , protect< aux::remove_if_helper<
\r
53 typename lambda<Predicate>::type
\r
54 , typename Inserter::operation
\r
62 , typename Predicate
\r
65 struct reverse_remove_if_impl
\r
68 , typename Inserter::state
\r
69 , protect< aux::remove_if_helper<
\r
70 typename lambda<Predicate>::type
\r
71 , typename Inserter::operation
\r
79 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if)
\r
83 #endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED
\r