Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003     Copyright (c) 2015 Kohei Takahashi
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(FUSION_ACCUMULATE_09172005_1032)
0009 #define FUSION_ACCUMULATE_09172005_1032
0010 
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/algorithm/iteration/accumulate_fwd.hpp>
0013 #include <boost/fusion/algorithm/iteration/fold.hpp>
0014 
0015 namespace boost { namespace fusion
0016 {
0017     struct void_;
0018 
0019     namespace result_of
0020     {
0021         template <typename Sequence, typename State, typename F>
0022         struct accumulate
0023             : result_of::fold<Sequence, State, F>
0024         {};
0025     }
0026 
0027     template <typename Sequence, typename State, typename F>
0028     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0029     inline typename result_of::accumulate<Sequence, State const, F>::type
0030     accumulate(Sequence& seq, State const& state, F f)
0031     {
0032         return fusion::fold(seq, state, f);
0033     }
0034 
0035     template <typename Sequence, typename State, typename F>
0036     BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0037     inline typename result_of::accumulate<Sequence const, State const, F>::type
0038     accumulate(Sequence const& seq, State const& state, F f)
0039     {
0040         return fusion::fold(seq, state, f);
0041     }
0042 }}
0043 
0044 #endif
0045