1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/mpl/remove_if.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,83 @@
1.4 +
1.5 +#ifndef BOOST_MPL_REMOVE_IF_HPP_INCLUDED
1.6 +#define BOOST_MPL_REMOVE_IF_HPP_INCLUDED
1.7 +
1.8 +// Copyright Aleksey Gurtovoy 2000-2004
1.9 +// Copyright David Abrahams 2003-2004
1.10 +//
1.11 +// Distributed under the Boost Software License, Version 1.0.
1.12 +// (See accompanying file LICENSE_1_0.txt or copy at
1.13 +// http://www.boost.org/LICENSE_1_0.txt)
1.14 +//
1.15 +// See http://www.boost.org/libs/mpl for documentation.
1.16 +
1.17 +// $Source: /cvsroot/boost/boost/boost/mpl/remove_if.hpp,v $
1.18 +// $Date: 2004/09/02 15:40:42 $
1.19 +// $Revision: 1.7 $
1.20 +
1.21 +#include <boost/mpl/fold.hpp>
1.22 +#include <boost/mpl/reverse_fold.hpp>
1.23 +#include <boost/mpl/eval_if.hpp>
1.24 +#include <boost/mpl/identity.hpp>
1.25 +#include <boost/mpl/protect.hpp>
1.26 +#include <boost/mpl/lambda.hpp>
1.27 +#include <boost/mpl/apply.hpp>
1.28 +#include <boost/mpl/aux_/inserter_algorithm.hpp>
1.29 +
1.30 +namespace boost { namespace mpl {
1.31 +
1.32 +namespace aux {
1.33 +
1.34 +template< typename Pred, typename InsertOp > struct remove_if_helper
1.35 +{
1.36 + template< typename Sequence, typename U > struct apply
1.37 + {
1.38 + typedef typename eval_if<
1.39 + typename apply1<Pred,U>::type
1.40 + , identity<Sequence>
1.41 + , apply2<InsertOp,Sequence,U>
1.42 + >::type type;
1.43 + };
1.44 +};
1.45 +
1.46 +template<
1.47 + typename Sequence
1.48 + , typename Predicate
1.49 + , typename Inserter
1.50 + >
1.51 +struct remove_if_impl
1.52 + : fold<
1.53 + Sequence
1.54 + , typename Inserter::state
1.55 + , protect< aux::remove_if_helper<
1.56 + typename lambda<Predicate>::type
1.57 + , typename Inserter::operation
1.58 + > >
1.59 + >
1.60 +{
1.61 +};
1.62 +
1.63 +template<
1.64 + typename Sequence
1.65 + , typename Predicate
1.66 + , typename Inserter
1.67 + >
1.68 +struct reverse_remove_if_impl
1.69 + : reverse_fold<
1.70 + Sequence
1.71 + , typename Inserter::state
1.72 + , protect< aux::remove_if_helper<
1.73 + typename lambda<Predicate>::type
1.74 + , typename Inserter::operation
1.75 + > >
1.76 + >
1.77 +{
1.78 +};
1.79 +
1.80 +} // namespace aux
1.81 +
1.82 +BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if)
1.83 +
1.84 +}}
1.85 +
1.86 +#endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED