File indexing completed on 2025-01-18 09:31:09
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_FUSION_SEGMENTED_FOR_EACH_HPP_INCLUDED)
0008 #define BOOST_FUSION_SEGMENTED_FOR_EACH_HPP_INCLUDED
0009
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/mpl/bool.hpp>
0012 #include <boost/fusion/support/void.hpp>
0013 #include <boost/fusion/algorithm/iteration/for_each_fwd.hpp>
0014 #include <boost/fusion/support/segmented_fold_until.hpp>
0015
0016 #ifdef _MSC_VER
0017 # pragma warning(push)
0018 # pragma warning(disable: 4512)
0019 #endif
0020
0021 namespace boost { namespace fusion { namespace detail
0022 {
0023 template <typename Fun>
0024 struct segmented_for_each_fun
0025 {
0026 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0027 explicit segmented_for_each_fun(Fun& f)
0028 : fun(f)
0029 {}
0030
0031 Fun& fun;
0032
0033 template <typename Sequence, typename State, typename Context>
0034 struct apply
0035 {
0036 typedef void_ type;
0037 typedef mpl::true_ continue_type;
0038
0039 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0040 static type call(Sequence& seq, State const&, Context const&, segmented_for_each_fun const& fun)
0041 {
0042 fusion::for_each(seq, fun.fun);
0043 return void_();
0044 }
0045 };
0046 };
0047
0048 template <typename Sequence, typename F>
0049 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0050 inline void
0051 for_each(Sequence& seq, F& f, mpl::true_)
0052 {
0053 fusion::segmented_fold_until(seq, void_(), segmented_for_each_fun<F>(f));
0054 }
0055 }}}
0056
0057 #ifdef _MSC_VER
0058 # pragma warning(pop)
0059 #endif
0060
0061 #endif