Back to home page

EIC code displayed by LXR

 
 

    


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

0001 
0002 #ifndef BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
0003 #define BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
0004 
0005 // Copyright Eric Friedman 2002-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/fold.hpp>
0019 #include <boost/mpl/reverse_fold.hpp>
0020 #include <boost/mpl/protect.hpp>
0021 #include <boost/mpl/aux_/partition_op.hpp>
0022 #include <boost/mpl/aux_/inserter_algorithm.hpp>
0023 #include <boost/mpl/aux_/na.hpp>
0024 
0025 namespace boost { namespace mpl {
0026 
0027 namespace aux {
0028  
0029 template <
0030       typename Sequence
0031     , typename Pred
0032     , typename In
0033     , typename In2
0034     , typename In1 = typename if_na<In,In2>::type
0035     >
0036 struct stable_partition_impl
0037     : fold<
0038           Sequence
0039         , pair< typename In1::state, typename In2::state >
0040         , protect< partition_op< 
0041               Pred
0042             , typename In1::operation
0043             , typename In2::operation
0044             > >
0045         >
0046 {
0047 };
0048 
0049 template <
0050       typename Sequence
0051     , typename Pred
0052     , typename In
0053     , typename In2
0054     , typename In1 = typename if_na<In,In2>::type
0055     >
0056 struct reverse_stable_partition_impl
0057     : reverse_fold<
0058           Sequence
0059         , pair< typename In1::state, typename In2::state >
0060         , protect< partition_op< 
0061               Pred
0062             , typename In1::operation
0063             , typename In2::operation
0064             > >
0065         >
0066 {
0067 };
0068 
0069 } // namespace aux
0070 
0071 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, stable_partition)
0072 
0073 }}
0074 
0075 #endif // BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED