1 /*=============================================================================
2 Copyright (c) 2009 Hartmut Kaiser
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
8 #if !defined(BOOST_FUSION_NVIEW_DEREF_IMPL_SEP_24_2009_0818AM)
9 #define BOOST_FUSION_NVIEW_DEREF_IMPL_SEP_24_2009_0818AM
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/iterator/value_of.hpp>
13 #include <boost/fusion/sequence/intrinsic/at.hpp>
15 namespace boost { namespace fusion
17 struct nview_iterator_tag;
21 template<typename Tag>
25 struct deref_impl<nview_iterator_tag>
27 template<typename Iterator>
30 typedef typename Iterator::first_type first_type;
31 typedef typename Iterator::sequence_type sequence_type;
33 typedef typename result_of::value_of<first_type>::type index;
34 typedef typename result_of::at<
35 typename sequence_type::sequence_type, index>::type type;
37 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
38 static type call(Iterator const& i)
40 return at<index>(i.seq.seq);