Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:48:04

0001 
0002 #ifndef BOOST_MPL_REMOVE_IF_HPP_INCLUDED
0003 #define BOOST_MPL_REMOVE_IF_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2004
0006 // Copyright David Abrahams 2003-2004
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. 
0009 // (See accompanying file LICENSE_1_0.txt or copy at 
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // See http://www.boost.org/libs/mpl for documentation.
0013 
0014 // $Id$
0015 // $Date$
0016 // $Revision$
0017 
0018 #include <boost/mpl/fold.hpp>
0019 #include <boost/mpl/reverse_fold.hpp>
0020 #include <boost/mpl/eval_if.hpp>
0021 #include <boost/mpl/identity.hpp>
0022 #include <boost/mpl/protect.hpp>
0023 #include <boost/mpl/lambda.hpp>
0024 #include <boost/mpl/apply.hpp>
0025 #include <boost/mpl/aux_/inserter_algorithm.hpp>
0026 
0027 namespace boost { namespace mpl {
0028 
0029 namespace aux {
0030 
0031 template< typename Pred, typename InsertOp > struct remove_if_helper
0032 {
0033     template< typename Sequence, typename U > struct apply
0034     {
0035         typedef typename eval_if<
0036               typename apply1<Pred,U>::type
0037             , identity<Sequence>
0038             , apply2<InsertOp,Sequence,U>
0039             >::type type;
0040     };
0041 };
0042 
0043 template<
0044       typename Sequence
0045     , typename Predicate
0046     , typename Inserter
0047     >
0048 struct remove_if_impl
0049     : fold<
0050           Sequence
0051         , typename Inserter::state
0052         , protect< aux::remove_if_helper<
0053               typename lambda<Predicate>::type
0054             , typename Inserter::operation
0055             > >
0056         >
0057 {
0058 };
0059 
0060 template<
0061       typename Sequence
0062     , typename Predicate
0063     , typename Inserter
0064     >
0065 struct reverse_remove_if_impl
0066     : reverse_fold<
0067           Sequence
0068         , typename Inserter::state
0069         , protect< aux::remove_if_helper<
0070               typename lambda<Predicate>::type
0071             , typename Inserter::operation
0072             > >
0073         >
0074 {
0075 };
0076 
0077 } // namespace aux
0078 
0079 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if)
0080 
0081 }}
0082 
0083 #endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED