sl@0
|
1 |
|
sl@0
|
2 |
#ifndef BOOST_MPL_REPLACE_IF_HPP_INCLUDED
|
sl@0
|
3 |
#define BOOST_MPL_REPLACE_IF_HPP_INCLUDED
|
sl@0
|
4 |
|
sl@0
|
5 |
// Copyright Aleksey Gurtovoy 2000-2004
|
sl@0
|
6 |
// Copyright John R. Bandela 2000-2002
|
sl@0
|
7 |
// Copyright David Abrahams 2003-2004
|
sl@0
|
8 |
//
|
sl@0
|
9 |
// Distributed under the Boost Software License, Version 1.0.
|
sl@0
|
10 |
// (See accompanying file LICENSE_1_0.txt or copy at
|
sl@0
|
11 |
// http://www.boost.org/LICENSE_1_0.txt)
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// See http://www.boost.org/libs/mpl for documentation.
|
sl@0
|
14 |
|
sl@0
|
15 |
// $Source: /cvsroot/boost/boost/boost/mpl/replace_if.hpp,v $
|
sl@0
|
16 |
// $Date: 2004/11/28 01:57:09 $
|
sl@0
|
17 |
// $Revision: 1.7 $
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <boost/mpl/transform.hpp>
|
sl@0
|
20 |
#include <boost/mpl/apply.hpp>
|
sl@0
|
21 |
#include <boost/mpl/if.hpp>
|
sl@0
|
22 |
#include <boost/mpl/aux_/inserter_algorithm.hpp>
|
sl@0
|
23 |
#include <boost/mpl/aux_/config/forwarding.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< typename Predicate, typename T >
|
sl@0
|
30 |
struct replace_if_op
|
sl@0
|
31 |
{
|
sl@0
|
32 |
template< typename U > struct apply
|
sl@0
|
33 |
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
sl@0
|
34 |
: if_<
|
sl@0
|
35 |
typename apply1<Predicate,U>::type
|
sl@0
|
36 |
, T
|
sl@0
|
37 |
, U
|
sl@0
|
38 |
>
|
sl@0
|
39 |
{
|
sl@0
|
40 |
#else
|
sl@0
|
41 |
{
|
sl@0
|
42 |
typedef typename if_<
|
sl@0
|
43 |
typename apply1<Predicate,U>::type
|
sl@0
|
44 |
, T
|
sl@0
|
45 |
, U
|
sl@0
|
46 |
>::type type;
|
sl@0
|
47 |
#endif
|
sl@0
|
48 |
};
|
sl@0
|
49 |
};
|
sl@0
|
50 |
|
sl@0
|
51 |
|
sl@0
|
52 |
template<
|
sl@0
|
53 |
typename Sequence
|
sl@0
|
54 |
, typename Predicate
|
sl@0
|
55 |
, typename T
|
sl@0
|
56 |
, typename Inserter
|
sl@0
|
57 |
>
|
sl@0
|
58 |
struct replace_if_impl
|
sl@0
|
59 |
: transform1_impl<
|
sl@0
|
60 |
Sequence
|
sl@0
|
61 |
, protect< aux::replace_if_op<Predicate,T> >
|
sl@0
|
62 |
, Inserter
|
sl@0
|
63 |
>
|
sl@0
|
64 |
{
|
sl@0
|
65 |
};
|
sl@0
|
66 |
|
sl@0
|
67 |
template<
|
sl@0
|
68 |
typename Sequence
|
sl@0
|
69 |
, typename Predicate
|
sl@0
|
70 |
, typename T
|
sl@0
|
71 |
, typename Inserter
|
sl@0
|
72 |
>
|
sl@0
|
73 |
struct reverse_replace_if_impl
|
sl@0
|
74 |
: reverse_transform1_impl<
|
sl@0
|
75 |
Sequence
|
sl@0
|
76 |
, protect< aux::replace_if_op<Predicate,T> >
|
sl@0
|
77 |
, Inserter
|
sl@0
|
78 |
>
|
sl@0
|
79 |
{
|
sl@0
|
80 |
};
|
sl@0
|
81 |
|
sl@0
|
82 |
} // namespace aux
|
sl@0
|
83 |
|
sl@0
|
84 |
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, replace_if)
|
sl@0
|
85 |
|
sl@0
|
86 |
}}
|
sl@0
|
87 |
|
sl@0
|
88 |
#endif // BOOST_MPL_REPLACE_IF_HPP_INCLUDED
|