41 #ifndef PB_DS_BASIC_TYPES_HPP
42 #define PB_DS_BASIC_TYPES_HPP
53 template<
typename Key,
typename Mapped,
typename Allocator,
bool Store_Hash>
54 struct value_type_base;
60 template<
typename Key,
typename Mapped,
typename Allocator>
61 struct value_type_base<Key, Mapped, Allocator, false>
63 typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
64 typedef typename mapped_type_allocator::value_type mapped_type;
65 typedef typename mapped_type_allocator::pointer mapped_pointer;
66 typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
67 typedef typename mapped_type_allocator::reference mapped_reference;
68 typedef typename mapped_type_allocator::const_reference const_mapped_reference;
70 typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
71 typedef typename value_type_allocator::value_type value_type;
72 typedef typename value_type_allocator::pointer pointer;
73 typedef typename value_type_allocator::const_pointer const_pointer;
74 typedef typename value_type_allocator::reference reference;
75 typedef typename value_type_allocator::const_reference const_reference;
77 struct stored_value_type
87 template<
typename Key,
typename Mapped,
typename Allocator>
88 struct value_type_base<Key, Mapped, Allocator, true>
90 typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
91 typedef typename mapped_type_allocator::value_type mapped_type;
92 typedef typename mapped_type_allocator::pointer mapped_pointer;
93 typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
94 typedef typename mapped_type_allocator::reference mapped_reference;
95 typedef typename mapped_type_allocator::const_reference const_mapped_reference;
97 typedef typename Allocator::template rebind<std::pair<const Key, Mapped> >::other value_type_allocator;
98 typedef typename value_type_allocator::value_type value_type;
99 typedef typename value_type_allocator::pointer pointer;
100 typedef typename value_type_allocator::const_pointer const_pointer;
101 typedef typename value_type_allocator::reference reference;
102 typedef typename value_type_allocator::const_reference const_reference;
104 struct stored_value_type
107 typename Allocator::size_type m_hash;
111 #define PB_DS_CLASS_T_DEC \
112 template<typename Key, typename Allocator>
114 #define PB_DS_CLASS_C_DEC \
115 value_type_base<Key, null_mapped_type, Allocator, false>
121 template<
typename Key,
typename Allocator>
124 typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
125 typedef typename mapped_type_allocator::value_type mapped_type;
126 typedef typename mapped_type_allocator::pointer mapped_pointer;
127 typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
128 typedef typename mapped_type_allocator::reference mapped_reference;
129 typedef typename mapped_type_allocator::const_reference const_mapped_reference;
131 typedef Key value_type;
133 typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
134 typedef typename value_type_allocator::pointer pointer;
135 typedef typename value_type_allocator::const_pointer const_pointer;
136 typedef typename value_type_allocator::reference reference;
137 typedef typename value_type_allocator::const_reference const_reference;
139 struct stored_value_type
150 #undef PB_DS_CLASS_T_DEC
151 #undef PB_DS_CLASS_C_DEC
153 #define PB_DS_CLASS_T_DEC \
154 template<typename Key, typename Allocator>
156 #define PB_DS_CLASS_C_DEC \
157 value_type_base<Key, null_mapped_type, Allocator, true>
163 template<
typename Key,
typename Allocator>
166 typedef typename Allocator::template rebind<null_mapped_type>::other mapped_type_allocator;
167 typedef typename mapped_type_allocator::value_type mapped_type;
168 typedef typename mapped_type_allocator::pointer mapped_pointer;
169 typedef typename mapped_type_allocator::const_pointer const_mapped_pointer;
170 typedef typename mapped_type_allocator::reference mapped_reference;
171 typedef typename mapped_type_allocator::const_reference const_mapped_reference;
173 typedef Key value_type;
175 typedef typename Allocator::template rebind<value_type>::other value_type_allocator;
176 typedef typename value_type_allocator::pointer pointer;
177 typedef typename value_type_allocator::const_pointer const_pointer;
178 typedef typename value_type_allocator::reference reference;
179 typedef typename value_type_allocator::const_reference const_reference;
181 struct stored_value_type
184 typename Allocator::size_type m_hash;
193 #undef PB_DS_CLASS_T_DEC
194 #undef PB_DS_CLASS_C_DEC
196 template<
typename Key,
typename Mapped>
197 struct no_throw_copies
199 typedef integral_constant<int, is_simple<Key>::value && is_simple<Mapped>::value> indicator;
202 template<
typename Key>
205 typedef integral_constant<int, is_simple<Key>::value> indicator;
A mapped-policy indicating that an associative container is a set.