]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/include/boost/mpl/copy_if.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / mpl / include / boost / mpl / copy_if.hpp
1
2 #ifndef BOOST_MPL_COPY_IF_HPP_INCLUDED
3 #define BOOST_MPL_COPY_IF_HPP_INCLUDED
4
5 // Copyright Aleksey Gurtovoy 2000-2004
6 // Copyright David Abrahams 2003-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$
15 // $Date$
16 // $Revision$
17
18 #include <boost/mpl/fold.hpp>
19 #include <boost/mpl/reverse_fold.hpp>
20 #include <boost/mpl/apply.hpp>
21 #include <boost/mpl/eval_if.hpp>
22 #include <boost/mpl/identity.hpp>
23 #include <boost/mpl/protect.hpp>
24 #include <boost/mpl/aux_/inserter_algorithm.hpp>
25 #include <boost/mpl/aux_/config/forwarding.hpp>
26
27 namespace boost { namespace mpl {
28
29 namespace aux {
30
31 template<
32 typename Operation
33 , typename Predicate
34 >
35 struct copy_if_op
36 {
37 template< typename Sequence, typename T > struct apply
38 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
39 : eval_if<
40 typename apply1<Predicate,T>::type
41 , apply2<Operation,Sequence,T>
42 , identity<Sequence>
43 >
44 {
45 #else
46 {
47 typedef typename eval_if<
48 typename apply1<Predicate,T>::type
49 , apply2<Operation,Sequence,T>
50 , identity<Sequence>
51 >::type type;
52 #endif
53 };
54 };
55
56 template<
57 typename Sequence
58 , typename Predicate
59 , typename Inserter
60 >
61 struct copy_if_impl
62 : fold<
63 Sequence
64 , typename Inserter::state
65 , protect< aux::copy_if_op<
66 typename Inserter::operation
67 , Predicate
68 > >
69 >
70 {
71 };
72
73 template<
74 typename Sequence
75 , typename Predicate
76 , typename Inserter
77 >
78 struct reverse_copy_if_impl
79 : reverse_fold<
80 Sequence
81 , typename Inserter::state
82 , protect< aux::copy_if_op<
83 typename Inserter::operation
84 , Predicate
85 > >
86 >
87 {
88 };
89
90 } // namespace aux
91
92 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, copy_if)
93
94 }}
95
96 #endif // BOOST_MPL_COPY_IF_HPP_INCLUDED