File indexing completed on 2025-01-18 09:35:00
0001
0002
0003
0004
0005
0006
0007
0008 #if !defined(FUSION_PREV_IMPL_13122005_2110)
0009 #define FUSION_PREV_IMPL_13122005_2110
0010
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/fusion/iterator/prior.hpp>
0013
0014 namespace boost { namespace fusion
0015 {
0016 struct transform_view_iterator_tag;
0017 struct transform_view_iterator2_tag;
0018
0019 template<typename First, typename F>
0020 struct transform_view_iterator;
0021
0022 template <typename First1, typename First2, typename F>
0023 struct transform_view_iterator2;
0024
0025 namespace extension
0026 {
0027 template<typename Tag>
0028 struct prior_impl;
0029
0030
0031 template<>
0032 struct prior_impl<transform_view_iterator_tag>
0033 {
0034 template<typename Iterator>
0035 struct apply
0036 {
0037 typedef typename Iterator::first_type first_type;
0038 typedef typename result_of::prior<first_type>::type prior_type;
0039 typedef typename Iterator::transform_type transform_type;
0040 typedef transform_view_iterator<prior_type, transform_type> type;
0041
0042 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0043 static type
0044 call(Iterator const& i)
0045 {
0046 return type(fusion::prior(i.first), i.f);
0047 }
0048 };
0049 };
0050
0051
0052 template<>
0053 struct prior_impl<transform_view_iterator2_tag>
0054 {
0055 template<typename Iterator>
0056 struct apply
0057 {
0058 typedef typename Iterator::first1_type first1_type;
0059 typedef typename Iterator::first2_type first2_type;
0060 typedef typename result_of::prior<first1_type>::type prior1_type;
0061 typedef typename result_of::prior<first2_type>::type prior2_type;
0062 typedef typename Iterator::transform_type transform_type;
0063 typedef transform_view_iterator2<prior1_type, prior2_type, transform_type> type;
0064
0065 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0066 static type
0067 call(Iterator const& i)
0068 {
0069 return type(fusion::prior(i.first1), fusion::prior(i.first2), i.f);
0070 }
0071 };
0072 };
0073 }
0074 }}
0075
0076 #endif