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