1 /*=============================================================================
2 Copyright (c) 2005-2012 Joel de Guzman
3 Copyright (c) 2005-2006 Dan Marsden
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901)
9 #define BOOST_FUSION_DEQUE_DETAIL_CPP11_DEQUE_KEYED_VALUES_07042012_1901
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/support/detail/access.hpp>
13 #include <boost/fusion/container/deque/detail/keyed_element.hpp>
14 #include <boost/mpl/int.hpp>
16 namespace boost { namespace fusion { namespace detail
18 template<typename Key, typename Value, typename Rest>
21 template <typename N, typename ...Elements>
22 struct deque_keyed_values_impl;
24 template <typename N, typename Head, typename ...Tail>
25 struct deque_keyed_values_impl<N, Head, Tail...>
27 typedef mpl::int_<(N::value + 1)> next_index;
28 typedef typename deque_keyed_values_impl<next_index, Tail...>::type tail;
29 typedef keyed_element<N, Head, tail> type;
31 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
32 static type construct(
33 typename detail::call_param<Head>::type head
34 , typename detail::call_param<Tail>::type... tail)
38 , deque_keyed_values_impl<next_index, Tail...>::construct(tail...)
41 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
42 template <typename Head_, typename ...Tail_>
43 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
44 static type forward_(Head_&& head, Tail_&&... tail)
47 BOOST_FUSION_FWD_ELEM(Head_, head)
48 , deque_keyed_values_impl<next_index, Tail_...>::
49 forward_(BOOST_FUSION_FWD_ELEM(Tail_, tail)...)
55 struct nil_keyed_element;
58 struct deque_keyed_values_impl<N>
60 typedef nil_keyed_element type;
62 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
63 static type construct() { return type(); }
65 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
66 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
67 static type forward_() { return type(); }
71 template <typename ...Elements>
72 struct deque_keyed_values
73 : deque_keyed_values_impl<mpl::int_<0>, Elements...> {};