PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/mpl/replace_if.hpp

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