File indexing completed on 2025-12-15 09:49:48
0001
0002
0003
0004
0005
0006
0007 #if !defined(FUSION_DEREF_05042005_1019)
0008 #define FUSION_DEREF_05042005_1019
0009
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/support/iterator_base.hpp>
0012 #include <boost/fusion/support/tag_of.hpp>
0013
0014 namespace boost { namespace fusion
0015 {
0016
0017 struct iterator_facade_tag;
0018 struct boost_array_iterator_tag;
0019 struct mpl_iterator_tag;
0020 struct std_pair_iterator_tag;
0021
0022 namespace extension
0023 {
0024 template <typename Tag>
0025 struct deref_impl
0026 {
0027 template <typename Iterator>
0028 struct apply {};
0029 };
0030
0031 template <>
0032 struct deref_impl<iterator_facade_tag>
0033 {
0034 template <typename Iterator>
0035 struct apply : Iterator::template deref<Iterator> {};
0036 };
0037
0038 template <>
0039 struct deref_impl<boost_array_iterator_tag>;
0040
0041 template <>
0042 struct deref_impl<mpl_iterator_tag>;
0043
0044 template <>
0045 struct deref_impl<std_pair_iterator_tag>;
0046 }
0047
0048 namespace result_of
0049 {
0050 template <typename Iterator>
0051 struct deref
0052 : extension::deref_impl<typename detail::tag_of<Iterator>::type>::
0053 template apply<Iterator>
0054 {};
0055 }
0056
0057 template <typename Iterator>
0058 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0059 inline typename result_of::deref<Iterator>::type
0060 deref(Iterator const& i)
0061 {
0062 typedef result_of::deref<Iterator> deref_meta;
0063 return deref_meta::call(i);
0064 }
0065
0066 template <typename Iterator>
0067 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0068 inline typename result_of::deref<Iterator>::type
0069 operator*(iterator_base<Iterator> const& i)
0070 {
0071 return fusion::deref(i.cast());
0072 }
0073 }}
0074
0075 #endif