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_MAP_TIE_07222005_1247)
|
Chris@16
|
8 #define FUSION_MAP_TIE_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_map_tie.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/pair.hpp>
|
Chris@16
|
21
|
Chris@16
|
22 namespace boost { namespace fusion
|
Chris@16
|
23 {
|
Chris@16
|
24 namespace result_of
|
Chris@16
|
25 {
|
Chris@16
|
26 template <typename ...Key>
|
Chris@16
|
27 struct map_tie
|
Chris@16
|
28 {
|
Chris@16
|
29 template <typename ...T>
|
Chris@16
|
30 struct apply
|
Chris@16
|
31 {
|
Chris@16
|
32 typedef map<fusion::pair<Key, T&>...> type;
|
Chris@101
|
33 };
|
Chris@16
|
34 };
|
Chris@16
|
35 }
|
Chris@16
|
36
|
Chris@16
|
37 template <typename ...Key, typename ...T>
|
Chris@101
|
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
39 inline map<fusion::pair<Key, T&>...>
|
Chris@16
|
40 map_tie(T&... arg)
|
Chris@16
|
41 {
|
Chris@16
|
42 typedef map<fusion::pair<Key, T&>...> result_type;
|
Chris@16
|
43 return result_type(arg...);
|
Chris@16
|
44 }
|
Chris@101
|
45 }}
|
Chris@16
|
46
|
Chris@16
|
47 #endif
|
Chris@101
|
48 #endif
|