Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2013 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(FUSION_MAKE_MAP_07222005_1247)
|
Chris@16
|
8 #define FUSION_MAKE_MAP_07222005_1247
|
Chris@16
|
9
|
Chris@101
|
10 #include <boost/fusion/support/config.hpp>
|
Chris@16
|
11 #include <boost/fusion/container/map/map.hpp>
|
Chris@16
|
12
|
Chris@16
|
13 #if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
|
Chris@16
|
14 # include <boost/fusion/container/generation/detail/pp_make_map.hpp>
|
Chris@16
|
15 #else
|
Chris@16
|
16
|
Chris@16
|
17 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
18 // C++11 variadic interface
|
Chris@16
|
19 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
20 #include <boost/fusion/support/detail/as_fusion_element.hpp>
|
Chris@16
|
21 #include <boost/fusion/support/pair.hpp>
|
Chris@16
|
22
|
Chris@16
|
23 namespace boost { namespace fusion
|
Chris@16
|
24 {
|
Chris@16
|
25 namespace result_of
|
Chris@16
|
26 {
|
Chris@16
|
27 template <typename ...Key>
|
Chris@16
|
28 struct make_map
|
Chris@16
|
29 {
|
Chris@16
|
30 template <typename ...T>
|
Chris@16
|
31 struct apply
|
Chris@16
|
32 {
|
Chris@16
|
33 typedef map<
|
Chris@16
|
34 fusion::pair<
|
Chris@16
|
35 Key
|
Chris@16
|
36 , typename detail::as_fusion_element<T>::type
|
Chris@16
|
37 >...>
|
Chris@16
|
38 type;
|
Chris@101
|
39 };
|
Chris@16
|
40 };
|
Chris@16
|
41 }
|
Chris@16
|
42
|
Chris@16
|
43 template <typename ...Key, typename ...T>
|
Chris@101
|
44 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
45 inline map<
|
Chris@16
|
46 fusion::pair<
|
Chris@16
|
47 Key
|
Chris@16
|
48 , typename detail::as_fusion_element<T>::type
|
Chris@16
|
49 >...>
|
Chris@16
|
50 make_map(T const&... arg)
|
Chris@16
|
51 {
|
Chris@16
|
52 typedef map<
|
Chris@16
|
53 fusion::pair<
|
Chris@16
|
54 Key
|
Chris@16
|
55 , typename detail::as_fusion_element<T>::type
|
Chris@16
|
56 >...>
|
Chris@16
|
57 result_type;
|
Chris@16
|
58
|
Chris@16
|
59 return result_type(arg...);
|
Chris@16
|
60 }
|
Chris@101
|
61 }}
|
Chris@16
|
62
|
Chris@16
|
63 #endif
|
Chris@101
|
64 #endif
|