2 #ifndef BOOST_MPL_REPLACE_IF_HPP_INCLUDED
\r
3 #define BOOST_MPL_REPLACE_IF_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2000-2004
\r
6 // Copyright John R. Bandela 2000-2002
\r
7 // Copyright David Abrahams 2003-2004
\r
9 // Distributed under the Boost Software License, Version 1.0.
\r
10 // (See accompanying file LICENSE_1_0.txt or copy at
\r
11 // http://www.boost.org/LICENSE_1_0.txt)
\r
13 // See http://www.boost.org/libs/mpl for documentation.
\r
15 // $Id: replace_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
16 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
17 // $Revision: 49267 $
\r
19 #include <boost/mpl/transform.hpp>
\r
20 #include <boost/mpl/apply.hpp>
\r
21 #include <boost/mpl/if.hpp>
\r
22 #include <boost/mpl/aux_/inserter_algorithm.hpp>
\r
23 #include <boost/mpl/aux_/config/forwarding.hpp>
\r
25 namespace boost { namespace mpl {
\r
29 template< typename Predicate, typename T >
\r
30 struct replace_if_op
\r
32 template< typename U > struct apply
\r
33 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
\r
35 typename apply1<Predicate,U>::type
\r
42 typedef typename if_<
\r
43 typename apply1<Predicate,U>::type
\r
54 , typename Predicate
\r
58 struct replace_if_impl
\r
61 , protect< aux::replace_if_op<Predicate,T> >
\r
69 , typename Predicate
\r
73 struct reverse_replace_if_impl
\r
74 : reverse_transform1_impl<
\r
76 , protect< aux::replace_if_op<Predicate,T> >
\r
84 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, replace_if)
\r
88 #endif // BOOST_MPL_REPLACE_IF_HPP_INCLUDED
\r