Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 #ifndef BOOST_MPL_AUX_PARTITION_OP_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_PARTITION_OP_HPP_INCLUDED
0004 
0005 // Copyright Eric Friedman 2003
0006 // Copyright Aleksey Gurtovoy 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/apply.hpp>
0019 #include <boost/mpl/eval_if.hpp>
0020 #include <boost/mpl/if.hpp>
0021 #include <boost/mpl/pair.hpp>
0022 #include <boost/mpl/aux_/lambda_spec.hpp>
0023 
0024 namespace boost { namespace mpl { 
0025 
0026 namespace aux {
0027 
0028 template< typename Pred, typename In1Op, typename In2Op >
0029 struct partition_op
0030 {
0031     template< typename State, typename T >
0032     struct apply
0033     {
0034         typedef typename State::first first_;
0035         typedef typename State::second second_;
0036         typedef typename apply1< Pred,T >::type pred_;
0037 
0038         typedef typename eval_if<
0039               pred_
0040             , apply2<In1Op,first_,T>
0041             , apply2<In2Op,second_,T>
0042             >::type result_;
0043 
0044         typedef typename if_<
0045               pred_
0046             , pair< result_,second_ >
0047             , pair< first_,result_ >
0048             >::type type;
0049     };
0050 };
0051 
0052 } // namespace aux
0053 
0054 BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, aux::partition_op)
0055 
0056 }}
0057 
0058 #endif // BOOST_MPL_AUX_PARTITION_OP_HPP_INCLUDED