File indexing completed on 2025-01-18 09:33:20
0001
0002
0003
0004
0005
0006
0007
0008 #if !defined(FUSION_DEREF_IMPL_07172005_0831)
0009 #define FUSION_DEREF_IMPL_07172005_0831
0010
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/mpl/eval_if.hpp>
0013 #include <boost/type_traits/is_const.hpp>
0014 #include <boost/type_traits/add_const.hpp>
0015 #include <boost/type_traits/add_reference.hpp>
0016
0017 namespace boost { namespace fusion
0018 {
0019 struct cons_iterator_tag;
0020
0021 namespace extension
0022 {
0023 template <typename Tag>
0024 struct deref_impl;
0025
0026 template <>
0027 struct deref_impl<cons_iterator_tag>
0028 {
0029 template <typename Iterator>
0030 struct apply
0031 {
0032 typedef typename Iterator::cons_type cons_type;
0033 typedef typename cons_type::car_type value_type;
0034
0035 typedef typename mpl::eval_if<
0036 is_const<cons_type>
0037 , add_reference<typename add_const<value_type>::type>
0038 , add_reference<value_type> >::type
0039 type;
0040
0041 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0042 static type
0043 call(Iterator const& i)
0044 {
0045 return i.cons.car;
0046 }
0047 };
0048 };
0049 }
0050 }}
0051
0052 #endif
0053
0054