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_SET_11062014_2121
8 #define FUSION_AS_SET_11062014_2121
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/container/set/set_fwd.hpp>
13 ///////////////////////////////////////////////////////////////////////////////
14 // Without variadics, we will use the PP version
15 ///////////////////////////////////////////////////////////////////////////////
16 #if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
17 # include <boost/fusion/container/set/detail/cpp03/as_set.hpp>
20 ///////////////////////////////////////////////////////////////////////////////
22 ///////////////////////////////////////////////////////////////////////////////
23 #include <boost/fusion/support/detail/index_sequence.hpp>
24 #include <boost/fusion/container/set/set.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
35 , typename = typename detail::make_index_sequence<size>::type>
38 template <int size, std::size_t ...Indices>
39 struct as_set<size, detail::index_sequence<Indices...> >
45 typename result_of::value_of<
46 typename result_of::advance_c<I, Indices>::type
51 template <typename Iterator>
52 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
53 static typename apply<Iterator>::type
54 call(Iterator const& i)
56 typedef apply<Iterator> gen;
57 typedef typename gen::type result;
58 return result(*advance_c<Indices>(i)...);
62 BOOST_FUSION_BARRIER_END