1 /*=============================================================================
2 Copyright (c) 2014-2015 Kohei Takahashi
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 ==============================================================================*/
7 #ifndef FUSION_AS_VECTOR_11052014_1801
8 #define FUSION_AS_VECTOR_11052014_1801
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/container/vector/detail/config.hpp>
13 ///////////////////////////////////////////////////////////////////////////////
14 // Without variadics, we will use the PP version
15 ///////////////////////////////////////////////////////////////////////////////
16 #if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
17 # include <boost/fusion/container/vector/detail/cpp03/as_vector.hpp>
20 ///////////////////////////////////////////////////////////////////////////////
22 ///////////////////////////////////////////////////////////////////////////////
23 #include <boost/fusion/support/detail/index_sequence.hpp>
24 #include <boost/fusion/container/vector/vector.hpp>
25 #include <boost/fusion/iterator/value_of.hpp>
26 #include <boost/fusion/iterator/deref.hpp>
27 #include <boost/fusion/iterator/advance.hpp>
30 namespace boost { namespace fusion { namespace detail
32 BOOST_FUSION_BARRIER_BEGIN
34 template <typename Indices>
35 struct as_vector_impl;
37 template <std::size_t ...Indices>
38 struct as_vector_impl<index_sequence<Indices...> >
40 template <typename Iterator>
44 typename result_of::value_of<
45 typename result_of::advance_c<Iterator, Indices>::type
50 template <typename Iterator>
51 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
52 static typename apply<Iterator>::type
55 typedef typename apply<Iterator>::type result;
56 return result(*advance_c<Indices>(i)...);
62 : as_vector_impl<typename make_index_sequence<size>::type> {};
64 BOOST_FUSION_BARRIER_END