comparison DEPENDENCIES/generic/include/boost/fusion/container/map/map.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_MAP_MAIN_07212005_1106) 7 #if !defined(FUSION_MAP_MAIN_07212005_1106)
8 #define FUSION_MAP_MAIN_07212005_1106 8 #define FUSION_MAP_MAIN_07212005_1106
9 9
10 #include <boost/fusion/support/config.hpp>
10 #include <boost/fusion/container/map/map_fwd.hpp> 11 #include <boost/fusion/container/map/map_fwd.hpp>
11 #include <boost/fusion/support/pair.hpp> 12 #include <boost/fusion/support/pair.hpp>
12 13
13 /////////////////////////////////////////////////////////////////////////////// 14 ///////////////////////////////////////////////////////////////////////////////
14 // Without variadics, we will use the PP version 15 // Without variadics, we will use the PP version
49 50
50 struct category : random_access_traversal_tag, associative_tag {}; 51 struct category : random_access_traversal_tag, associative_tag {};
51 typedef mpl::int_<base_type::size> size; 52 typedef mpl::int_<base_type::size> size;
52 typedef mpl::false_ is_view; 53 typedef mpl::false_ is_view;
53 54
55 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
54 map() {} 56 map() {}
55 57
58 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
56 map(map const& seq) 59 map(map const& seq)
57 : base_type(seq.base()) 60 : base_type(seq.base())
58 {} 61 {}
59 62
63 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
60 map(map&& seq) 64 map(map&& seq)
61 : base_type(std::forward<map>(seq)) 65 : base_type(std::forward<map>(seq))
62 {} 66 {}
63 67
64 template <typename Sequence> 68 template <typename Sequence>
69 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
65 map(Sequence const& seq 70 map(Sequence const& seq
66 , typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0) 71 , typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
67 : base_type(begin(seq), detail::map_impl_from_iterator()) 72 : base_type(begin(seq), detail::map_impl_from_iterator())
68 {} 73 {}
69 74
70 template <typename Sequence> 75 template <typename Sequence>
76 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
71 map(Sequence& seq 77 map(Sequence& seq
72 , typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0) 78 , typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
73 : base_type(begin(seq), detail::map_impl_from_iterator()) 79 : base_type(begin(seq), detail::map_impl_from_iterator())
74 {} 80 {}
75 81
76 template <typename Sequence> 82 template <typename Sequence>
83 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
77 map(Sequence&& seq 84 map(Sequence&& seq
78 , typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0) 85 , typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
79 : base_type(begin(seq), detail::map_impl_from_iterator()) 86 : base_type(begin(seq), detail::map_impl_from_iterator())
80 {} 87 {}
81 88
82 template <typename First, typename ...T_> 89 template <typename First, typename ...T_>
90 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
83 map(First const& first, T_ const&... rest) 91 map(First const& first, T_ const&... rest)
84 : base_type(first, rest...) 92 : base_type(first, rest...)
85 {} 93 {}
86 94
87 template <typename First, typename ...T_> 95 template <typename First, typename ...T_>
96 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
88 map(First&& first, T_&&... rest) 97 map(First&& first, T_&&... rest)
89 : base_type(std::forward<First>(first), std::forward<T_>(rest)...) 98 : base_type(BOOST_FUSION_FWD_ELEM(First, first), BOOST_FUSION_FWD_ELEM(T_, rest)...)
90 {} 99 {}
91 100
101 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
92 map& operator=(map const& rhs) 102 map& operator=(map const& rhs)
93 { 103 {
94 base_type::operator=(rhs.base()); 104 base_type::operator=(rhs.base());
95 return *this; 105 return *this;
96 } 106 }
97 107
108 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
98 map& operator=(map&& rhs) 109 map& operator=(map&& rhs)
99 { 110 {
100 base_type::operator=(std::forward<base_type>(rhs.base())); 111 base_type::operator=(std::forward<base_type>(rhs.base()));
101 return *this; 112 return *this;
102 } 113 }
103 114
104 template <typename Sequence> 115 template <typename Sequence>
116 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
105 typename enable_if<traits::is_sequence<Sequence>, map&>::type 117 typename enable_if<traits::is_sequence<Sequence>, map&>::type
106 operator=(Sequence const& seq) 118 operator=(Sequence const& seq)
107 { 119 {
108 base().assign(begin(seq), detail::map_impl_from_iterator()); 120 base().assign(begin(seq), detail::map_impl_from_iterator());
109 return *this; 121 return *this;
110 } 122 }
111 123
112 base_type& base() { return *this; } 124 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
113 base_type const& base() const { return *this; } 125 base_type& base() BOOST_NOEXCEPT { return *this; }
126 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
127 base_type const& base() const BOOST_NOEXCEPT { return *this; }
114 }; 128 };
115 }} 129 }}
116 130
117 #endif 131 #endif
118 #endif 132 #endif