PageRenderTime 19ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/extlibs/Boost/include/boost/mpl/stable_partition.hpp

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