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