Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:34:40

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_IMPL_05042005_1037)
0008 #define FUSION_DEREF_IMPL_05042005_1037
0009 
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/support/detail/access.hpp>
0012 #include <boost/fusion/container/vector/detail/value_at_impl.hpp>
0013 #include <boost/type_traits/is_const.hpp>
0014 #include <boost/mpl/if.hpp>
0015 
0016 namespace boost { namespace fusion
0017 {
0018     struct vector_iterator_tag;
0019 
0020     namespace extension
0021     {
0022         template <typename Tag>
0023         struct deref_impl;
0024 
0025         template <>
0026         struct deref_impl<vector_iterator_tag>
0027         {
0028             template <typename Iterator>
0029             struct apply
0030             {
0031                 typedef typename Iterator::vector vector;
0032                 typedef typename Iterator::index index;
0033                 typedef typename value_at_impl<vector_tag>::template apply<vector, index>::type element;
0034 
0035                 typedef typename
0036                     mpl::if_<
0037                         is_const<vector>
0038                       , typename fusion::detail::cref_result<element>::type
0039                       , typename fusion::detail::ref_result<element>::type
0040                     >::type
0041                 type;
0042 
0043                 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0044                 static type
0045                 call(Iterator const& i)
0046                 {
0047                     return i.vec.at_impl(index());
0048                 }
0049             };
0050         };
0051     }
0052 }}
0053 
0054 #endif