Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:48:04

0001 
0002 #ifndef BOOST_MPL_REPLACE_IF_HPP_INCLUDED
0003 #define BOOST_MPL_REPLACE_IF_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2004
0006 // Copyright John R. Bandela 2000-2002
0007 // Copyright David Abrahams 2003-2004
0008 //
0009 // Distributed under the Boost Software License, Version 1.0. 
0010 // (See accompanying file LICENSE_1_0.txt or copy at 
0011 // http://www.boost.org/LICENSE_1_0.txt)
0012 //
0013 // See http://www.boost.org/libs/mpl for documentation.
0014 
0015 // $Id$
0016 // $Date$
0017 // $Revision$
0018 
0019 #include <boost/mpl/transform.hpp>
0020 #include <boost/mpl/apply.hpp>
0021 #include <boost/mpl/if.hpp>
0022 #include <boost/mpl/aux_/inserter_algorithm.hpp>
0023 #include <boost/mpl/aux_/config/forwarding.hpp>
0024 
0025 namespace boost { namespace mpl {
0026 
0027 namespace aux {
0028 
0029 template< typename Predicate, typename T >
0030 struct replace_if_op
0031 {
0032     template< typename U > struct apply
0033 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
0034         : if_<
0035               typename apply1<Predicate,U>::type
0036             , T
0037             , U
0038             >
0039     {
0040 #else
0041     {
0042         typedef typename if_<
0043               typename apply1<Predicate,U>::type
0044             , T
0045             , U
0046             >::type type;
0047 #endif
0048     };
0049 };
0050 
0051 
0052 template<
0053       typename Sequence
0054     , typename Predicate
0055     , typename T
0056     , typename Inserter
0057     >
0058 struct replace_if_impl
0059     : transform1_impl<
0060           Sequence
0061         , protect< aux::replace_if_op<Predicate,T> >
0062         , Inserter
0063         >
0064 {
0065 };
0066 
0067 template<
0068       typename Sequence
0069     , typename Predicate
0070     , typename T
0071     , typename Inserter
0072     >
0073 struct reverse_replace_if_impl
0074     : reverse_transform1_impl<
0075           Sequence
0076         , protect< aux::replace_if_op<Predicate,T> >
0077         , Inserter
0078         >
0079 {
0080 };
0081 
0082 } // namespace aux
0083 
0084 BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, replace_if)
0085 
0086 }}
0087 
0088 #endif // BOOST_MPL_REPLACE_IF_HPP_INCLUDED