Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:49:48

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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     // Special tags:
0017     struct iterator_facade_tag; // iterator facade tag
0018     struct boost_array_iterator_tag; // boost::array iterator tag
0019     struct mpl_iterator_tag; // mpl sequence iterator tag
0020     struct std_pair_iterator_tag; // 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