sl@0
|
1 |
|
sl@0
|
2 |
#ifndef BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
|
sl@0
|
3 |
#define BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
|
sl@0
|
4 |
|
sl@0
|
5 |
// Copyright Eric Friedman 2002-2003
|
sl@0
|
6 |
// Copyright Aleksey Gurtovoy 2004
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Distributed under the Boost Software License, Version 1.0.
|
sl@0
|
9 |
// (See accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
10 |
// http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
11 |
//
|
sl@0
|
12 |
// See http://www.boost.org/libs/mpl for documentation.
|
sl@0
|
13 |
|
sl@0
|
14 |
// $Source: /cvsroot/boost/boost/boost/mpl/stable_partition.hpp,v $
|
sl@0
|
15 |
// $Date: 2004/11/28 01:58:27 $
|
sl@0
|
16 |
// $Revision: 1.4 $
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <boost/mpl/fold.hpp>
|
sl@0
|
19 |
#include <boost/mpl/reverse_fold.hpp>
|
sl@0
|
20 |
#include <boost/mpl/protect.hpp>
|
sl@0
|
21 |
#include <boost/mpl/aux_/partition_op.hpp>
|
sl@0
|
22 |
#include <boost/mpl/aux_/inserter_algorithm.hpp>
|
sl@0
|
23 |
#include <boost/mpl/aux_/na.hpp>
|
sl@0
|
24 |
|
sl@0
|
25 |
namespace boost { namespace mpl {
|
sl@0
|
26 |
|
sl@0
|
27 |
namespace aux {
|
sl@0
|
28 |
|
sl@0
|
29 |
template <
|
sl@0
|
30 |
typename Sequence
|
sl@0
|
31 |
, typename Pred
|
sl@0
|
32 |
, typename In
|
sl@0
|
33 |
, typename In2
|
sl@0
|
34 |
, typename In1 = typename if_na<In,In2>::type
|
sl@0
|
35 |
>
|
sl@0
|
36 |
struct stable_partition_impl
|
sl@0
|
37 |
: fold<
|
sl@0
|
38 |
Sequence
|
sl@0
|
39 |
, pair< typename In1::state, typename In2::state >
|
sl@0
|
40 |
, protect< partition_op<
|
sl@0
|
41 |
Pred
|
sl@0
|
42 |
, typename In1::operation
|
sl@0
|
43 |
, typename In2::operation
|
sl@0
|
44 |
> >
|
sl@0
|
45 |
>
|
sl@0
|
46 |
{
|
sl@0
|
47 |
};
|
sl@0
|
48 |
|
sl@0
|
49 |
template <
|
sl@0
|
50 |
typename Sequence
|
sl@0
|
51 |
, typename Pred
|
sl@0
|
52 |
, typename In
|
sl@0
|
53 |
, typename In2
|
sl@0
|
54 |
, typename In1 = typename if_na<In,In2>::type
|
sl@0
|
55 |
>
|
sl@0
|
56 |
struct reverse_stable_partition_impl
|
sl@0
|
57 |
: reverse_fold<
|
sl@0
|
58 |
Sequence
|
sl@0
|
59 |
, pair< typename In1::state, typename In2::state >
|
sl@0
|
60 |
, protect< partition_op<
|
sl@0
|
61 |
Pred
|
sl@0
|
62 |
, typename In1::operation
|
sl@0
|
63 |
, typename In2::operation
|
sl@0
|
64 |
> >
|
sl@0
|
65 |
>
|
sl@0
|
66 |
{
|
sl@0
|
67 |
};
|
sl@0
|
68 |
|
sl@0
|
69 |
} // namespace aux
|
sl@0
|
70 |
|
sl@0
|
71 |
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, stable_partition)
|
sl@0
|
72 |
|
sl@0
|
73 |
}}
|
sl@0
|
74 |
|
sl@0
|
75 |
#endif // BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
|