]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2013 Joel de Guzman | |
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 | #if !defined(FUSION_MAKE_MAP_07222005_1247) | |
8 | #define FUSION_MAKE_MAP_07222005_1247 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/container/map/map.hpp> | |
12 | ||
13 | #if !defined(BOOST_FUSION_HAS_VARIADIC_MAP) | |
14 | # include <boost/fusion/container/generation/detail/pp_make_map.hpp> | |
15 | #else | |
16 | ||
17 | /////////////////////////////////////////////////////////////////////////////// | |
18 | // C++11 variadic interface | |
19 | /////////////////////////////////////////////////////////////////////////////// | |
20 | #include <boost/fusion/support/detail/as_fusion_element.hpp> | |
21 | #include <boost/fusion/support/pair.hpp> | |
22 | ||
23 | namespace boost { namespace fusion | |
24 | { | |
25 | namespace result_of | |
26 | { | |
27 | template <typename ...Key> | |
28 | struct make_map | |
29 | { | |
30 | template <typename ...T> | |
31 | struct apply | |
32 | { | |
33 | typedef map< | |
34 | fusion::pair< | |
35 | Key | |
36 | , typename detail::as_fusion_element<T>::type | |
37 | >...> | |
38 | type; | |
39 | }; | |
40 | }; | |
41 | } | |
42 | ||
43 | template <typename ...Key, typename ...T> | |
44 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
45 | inline map< | |
46 | fusion::pair< | |
47 | Key | |
48 | , typename detail::as_fusion_element<T>::type | |
49 | >...> | |
50 | make_map(T const&... arg) | |
51 | { | |
52 | typedef map< | |
53 | fusion::pair< | |
54 | Key | |
55 | , typename detail::as_fusion_element<T>::type | |
56 | >...> | |
57 | result_type; | |
58 | ||
59 | return result_type(arg...); | |
60 | } | |
61 | }} | |
62 | ||
63 | #endif | |
64 | #endif |