]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/fusion/view/nview/detail/nview_impl.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / fusion / view / nview / detail / nview_impl.hpp
1 /*=============================================================================
2 Copyright (c) 2014 Kohei Takahashi
3
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 BOOST_FUSION_NVIEW_IMPL_17122014_1948
8 #define BOOST_FUSION_NVIEW_IMPL_17122014_1948
9
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/container/vector/detail/config.hpp>
12
13 ///////////////////////////////////////////////////////////////////////////////
14 // Without variadics, we will use the PP version
15 ///////////////////////////////////////////////////////////////////////////////
16 #if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
17 # include <boost/fusion/view/nview/detail/cpp03/nview_impl.hpp>
18 #else
19
20 ///////////////////////////////////////////////////////////////////////////////
21 // C++11 interface
22 ///////////////////////////////////////////////////////////////////////////////
23 #include <boost/fusion/container/vector.hpp>
24 #include <boost/mpl/int.hpp>
25
26 namespace boost { namespace fusion
27 {
28 namespace result_of
29 {
30 template <typename Sequence, int ...I>
31 struct as_nview
32 {
33 typedef vector<mpl::int_<I>...> index_type;
34 typedef nview<Sequence, index_type> type;
35 };
36 }
37
38 template <int ...I, typename Sequence>
39 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
40 inline nview<Sequence, vector<mpl::int_<I>...> >
41 as_nview(Sequence& s)
42 {
43 typedef vector<mpl::int_<I>...> index_type;
44 return nview<Sequence, index_type>(s);
45 }
46 }}
47
48 #endif
49 #endif
50