1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/mpl/copy_if.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,96 @@
1.4 +
1.5 +#ifndef BOOST_MPL_COPY_IF_HPP_INCLUDED
1.6 +#define BOOST_MPL_COPY_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/copy_if.hpp,v $
1.18 +// $Date: 2004/09/02 15:40:41 $
1.19 +// $Revision: 1.5 $
1.20 +
1.21 +#include <boost/mpl/fold.hpp>
1.22 +#include <boost/mpl/reverse_fold.hpp>
1.23 +#include <boost/mpl/apply.hpp>
1.24 +#include <boost/mpl/eval_if.hpp>
1.25 +#include <boost/mpl/identity.hpp>
1.26 +#include <boost/mpl/protect.hpp>
1.27 +#include <boost/mpl/aux_/inserter_algorithm.hpp>
1.28 +#include <boost/mpl/aux_/config/forwarding.hpp>
1.29 +
1.30 +namespace boost { namespace mpl {
1.31 +
1.32 +namespace aux {
1.33 +
1.34 +template<
1.35 + typename Operation
1.36 + , typename Predicate
1.37 + >
1.38 +struct copy_if_op
1.39 +{
1.40 + template< typename Sequence, typename T > struct apply
1.41 +#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
1.42 + : eval_if<
1.43 + typename apply1<Predicate,T>::type
1.44 + , apply2<Operation,Sequence,T>
1.45 + , identity<Sequence>
1.46 + >
1.47 + {
1.48 +#else
1.49 + {
1.50 + typedef typename eval_if<
1.51 + typename apply1<Predicate,T>::type
1.52 + , apply2<Operation,Sequence,T>
1.53 + , identity<Sequence>
1.54 + >::type type;
1.55 +#endif
1.56 + };
1.57 +};
1.58 +
1.59 +template<
1.60 + typename Sequence
1.61 + , typename Predicate
1.62 + , typename Inserter
1.63 + >
1.64 +struct copy_if_impl
1.65 + : fold<
1.66 + Sequence
1.67 + , typename Inserter::state
1.68 + , protect< aux::copy_if_op<
1.69 + typename Inserter::operation
1.70 + , Predicate
1.71 + > >
1.72 + >
1.73 +{
1.74 +};
1.75 +
1.76 +template<
1.77 + typename Sequence
1.78 + , typename Predicate
1.79 + , typename Inserter
1.80 + >
1.81 +struct reverse_copy_if_impl
1.82 + : reverse_fold<
1.83 + Sequence
1.84 + , typename Inserter::state
1.85 + , protect< aux::copy_if_op<
1.86 + typename Inserter::operation
1.87 + , Predicate
1.88 + > >
1.89 + >
1.90 +{
1.91 +};
1.92 +
1.93 +} // namespace aux
1.94 +
1.95 +BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, copy_if)
1.96 +
1.97 +}}
1.98 +
1.99 +#endif // BOOST_MPL_COPY_IF_HPP_INCLUDED