Files
boost_mpl/include/boost/mpl/stable_partition.hpp
T

76 lines
1.7 KiB
C++
Raw Normal View History

2003-10-22 01:03:06 +00:00
#ifndef BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
#define BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
2004-09-02 15:41:37 +00:00
// Copyright Eric Friedman 2002-2003
2004-11-28 01:58:27 +00:00
// Copyright Aleksey Gurtovoy 2004
2004-09-02 15:41:37 +00:00
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
2003-10-22 01:03:06 +00:00
2004-09-02 15:41:37 +00:00
// $Source$
// $Date$
// $Revision$
2003-10-22 01:03:06 +00:00
2004-11-28 01:58:27 +00:00
#include <boost/mpl/fold.hpp>
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/protect.hpp>
2004-09-02 15:41:37 +00:00
#include <boost/mpl/aux_/partition_op.hpp>
2004-11-28 01:58:27 +00:00
#include <boost/mpl/aux_/inserter_algorithm.hpp>
#include <boost/mpl/aux_/na.hpp>
2004-09-02 15:41:37 +00:00
namespace boost { namespace mpl {
2003-10-22 01:03:06 +00:00
2004-11-28 01:58:27 +00:00
namespace aux {
2003-10-22 01:03:06 +00:00
template <
2004-11-28 01:58:27 +00:00
typename Sequence
, typename Pred
, typename In
, typename In2
, typename In1 = typename if_na<In,In2>::type
2003-10-22 01:03:06 +00:00
>
2004-11-28 01:58:27 +00:00
struct stable_partition_impl
: fold<
2003-10-22 01:03:06 +00:00
Sequence
2004-11-28 01:58:27 +00:00
, pair< typename In1::state, typename In2::state >
, protect< partition_op<
Pred
, typename In1::operation
, typename In2::operation
> >
>
{
2003-10-22 01:03:06 +00:00
};
2004-11-28 01:58:27 +00:00
template <
typename Sequence
, typename Pred
, typename In
, typename In2
, typename In1 = typename if_na<In,In2>::type
>
struct reverse_stable_partition_impl
: reverse_fold<
Sequence
, pair< typename In1::state, typename In2::state >
, protect< partition_op<
Pred
, typename In1::operation
, typename In2::operation
> >
>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, stable_partition)
2003-10-22 01:03:06 +00:00
2004-09-02 15:41:37 +00:00
}}
2003-10-22 01:03:06 +00:00
#endif // BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED