Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:31:17

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(FUSION_REPLACE_08182005_0830)
0008 #define FUSION_REPLACE_08182005_0830
0009 
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/view/transform_view/transform_view.hpp>
0012 #include <boost/fusion/algorithm/transformation/detail/replace.hpp>
0013 #include <boost/fusion/support/is_sequence.hpp>
0014 #include <boost/utility/enable_if.hpp>
0015 
0016 namespace boost { namespace fusion
0017 {
0018     namespace result_of
0019     {
0020         template <typename Sequence, typename T>
0021         struct replace
0022         {
0023             typedef transform_view<Sequence, detail::replacer<T> > type;
0024         };
0025     }
0026 
0027     template <typename Sequence, typename T>
0028     BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0029     inline typename
0030         enable_if<
0031             traits::is_sequence<Sequence>
0032           , typename result_of::replace<Sequence const, T>::type
0033         >::type
0034     replace(Sequence const& seq, T const& old_value, T const& new_value)
0035     {
0036         typedef typename result_of::replace<Sequence const, T>::type result;
0037         detail::replacer<T> f(old_value, new_value);
0038         return result(seq, f);
0039     }
0040 }}
0041 
0042 #endif
0043