comparison DEPENDENCIES/generic/include/boost/fusion/container/map/convert.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/ 6 ==============================================================================*/
7 #if !defined(FUSION_CONVERT_MAIN_09232005_1340) 7 #if !defined(FUSION_CONVERT_MAIN_09232005_1340)
8 #define FUSION_CONVERT_MAIN_09232005_1340 8 #define FUSION_CONVERT_MAIN_09232005_1340
9 9
10 #include <boost/fusion/support/config.hpp>
10 #include <boost/fusion/container/map/map.hpp> 11 #include <boost/fusion/container/map/map.hpp>
12
13 namespace boost { namespace fusion { namespace detail
14 {
15 template <typename It, bool is_assoc>
16 struct pair_from
17 {
18 typedef typename result_of::value_of<It>::type type;
19
20 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
21 static inline type call(It const& it)
22 {
23 return *it;
24 }
25 };
26
27 template <typename It>
28 struct pair_from<It, true>
29 {
30 typedef typename result_of::key_of<It>::type key_type;
31 typedef typename result_of::value_of_data<It>::type data_type;
32 typedef typename fusion::pair<key_type, data_type> type;
33
34 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
35 static inline type call(It const& it)
36 {
37 return type(deref_data(it));
38 }
39 };
40 }}}
11 41
12 /////////////////////////////////////////////////////////////////////////////// 42 ///////////////////////////////////////////////////////////////////////////////
13 // Without variadics, we will use the PP version 43 // Without variadics, we will use the PP version
14 /////////////////////////////////////////////////////////////////////////////// 44 ///////////////////////////////////////////////////////////////////////////////
15 #if !defined(BOOST_FUSION_HAS_VARIADIC_MAP) 45 #if !defined(BOOST_FUSION_HAS_VARIADIC_MAP)
28 template <typename Sequence> 58 template <typename Sequence>
29 struct as_map : 59 struct as_map :
30 detail::build_map< 60 detail::build_map<
31 typename result_of::begin<Sequence>::type 61 typename result_of::begin<Sequence>::type
32 , typename result_of::end<Sequence>::type 62 , typename result_of::end<Sequence>::type
63 , is_base_of<
64 associative_tag
65 , typename traits::category_of<Sequence>::type>::value
33 > 66 >
34 { 67 {
35 }; 68 };
36 } 69 }
37 70
38 template <typename Sequence> 71 template <typename Sequence>
72 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
39 inline typename result_of::as_map<Sequence>::type 73 inline typename result_of::as_map<Sequence>::type
40 as_map(Sequence& seq) 74 as_map(Sequence& seq)
41 { 75 {
42 typedef result_of::as_map<Sequence> gen; 76 typedef result_of::as_map<Sequence> gen;
43 return gen::call(fusion::begin(seq), fusion::end(seq)); 77 return gen::call(fusion::begin(seq), fusion::end(seq));
44 } 78 }
45 79
46 template <typename Sequence> 80 template <typename Sequence>
81 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
47 inline typename result_of::as_map<Sequence const>::type 82 inline typename result_of::as_map<Sequence const>::type
48 as_map(Sequence const& seq) 83 as_map(Sequence const& seq)
49 { 84 {
50 typedef result_of::as_map<Sequence const> gen; 85 typedef result_of::as_map<Sequence const> gen;
51 return gen::call(fusion::begin(seq), fusion::end(seq)); 86 return gen::call(fusion::begin(seq), fusion::end(seq));
64 { 99 {
65 typedef typename 100 typedef typename
66 result_of::as_map<Sequence>::type 101 result_of::as_map<Sequence>::type
67 type; 102 type;
68 103
104 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
69 static type call(Sequence& seq) 105 static type call(Sequence& seq)
70 { 106 {
71 typedef result_of::as_map<Sequence> gen; 107 typedef result_of::as_map<Sequence> gen;
72 return gen::call(fusion::begin(seq), fusion::end(seq)); 108 return gen::call(fusion::begin(seq), fusion::end(seq));
73 } 109 }