]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | template <class Value, unsigned int Options = 0, class Hash = hash<Value>, class Pred = equal_to<Value>, | |
3 | class Allocator = allocator<Value> > | |
4 | class hash_set | |
5 | { | |
6 | public: | |
7 | // types | |
8 | typedef Value key_type; | |
9 | typedef key_type value_type; | |
10 | typedef Hash hasher; | |
11 | typedef Pred key_equal; | |
12 | typedef Allocator allocator_type; | |
13 | typedef value_type& reference; | |
14 | typedef const value_type& const_reference; | |
15 | typedef typename allocator_traits<allocator_type>::pointer pointer; | |
16 | typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; | |
17 | typedef typename allocator_traits<allocator_type>::size_type size_type; | |
18 | typedef typename allocator_traits<allocator_type>::difference_type difference_type; | |
19 | ||
20 | typedef /unspecified/ iterator; | |
21 | typedef /unspecified/ const_iterator; | |
22 | typedef /unspecified/ local_iterator; | |
23 | typedef /unspecified/ const_local_iterator; | |
24 | ||
25 | hash_set() | |
26 | noexcept( | |
27 | is_nothrow_default_constructible<hasher>::value && | |
28 | is_nothrow_default_constructible<key_equal>::value && | |
29 | is_nothrow_default_constructible<allocator_type>::value); | |
30 | explicit hash_set(size_type n, const hasher& hf = hasher(), | |
31 | const key_equal& eql = key_equal(), | |
32 | const allocator_type& a = allocator_type()); | |
33 | template <class InputIterator> | |
34 | hash_set(InputIterator f, InputIterator l, | |
35 | size_type n = 0, const hasher& hf = hasher(), | |
36 | const key_equal& eql = key_equal(), | |
37 | const allocator_type& a = allocator_type()); | |
38 | explicit hash_set(const allocator_type&); | |
39 | hash_set(const hash_set&); | |
40 | hash_set(const hash_set&, const Allocator&); | |
41 | hash_set(hash_set&&) | |
42 | noexcept( | |
43 | is_nothrow_move_constructible<hasher>::value && | |
44 | is_nothrow_move_constructible<key_equal>::value && | |
45 | is_nothrow_move_constructible<allocator_type>::value); | |
46 | hash_set(hash_set&&, const Allocator&); | |
47 | hash_set(initializer_list<value_type>, size_type n = 0, | |
48 | const hasher& hf = hasher(), const key_equal& eql = key_equal(), | |
49 | const allocator_type& a = allocator_type()); | |
50 | ~hash_set(); | |
51 | hash_set& operator=(const hash_set&); | |
52 | hash_set& operator=(hash_set&&) | |
53 | noexcept( | |
54 | allocator_type::propagate_on_container_move_assignment::value && | |
55 | is_nothrow_move_assignable<allocator_type>::value && | |
56 | is_nothrow_move_assignable<hasher>::value && | |
57 | is_nothrow_move_assignable<key_equal>::value); | |
58 | hash_set& operator=(initializer_list<value_type>); | |
59 | ||
60 | allocator_type get_allocator() const noexcept; | |
61 | ||
62 | bool empty() const noexcept; | |
63 | size_type size() const noexcept; | |
64 | size_type max_size() const noexcept; | |
65 | ||
66 | iterator begin() noexcept; | |
67 | iterator end() noexcept; | |
68 | const_iterator begin() const noexcept; | |
69 | const_iterator end() const noexcept; | |
70 | const_iterator cbegin() const noexcept; | |
71 | const_iterator cend() const noexcept; | |
72 | ||
73 | template <class... Args> | |
74 | pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args); | |
75 | template <class... Args> | |
76 | iterator emplace_hint(const_iterator position, BOOST_FWD_REF(Args)... args); | |
77 | pair<iterator, bool> insert(const value_type& obj); | |
78 | pair<iterator, bool> insert(value_type&& obj); | |
79 | iterator insert(const_iterator hint, const value_type& obj); | |
80 | iterator insert(const_iterator hint, value_type&& obj); | |
81 | template <class InputIterator> | |
82 | void insert(InputIterator first, InputIterator last); | |
83 | void insert(initializer_list<value_type>); | |
84 | ||
85 | iterator erase(const_iterator position); | |
86 | size_type erase(const key_type& k); | |
87 | iterator erase(const_iterator first, const_iterator last); | |
88 | void clear() noexcept; | |
89 | ||
90 | void swap(hash_set&) | |
91 | noexcept( | |
92 | (!allocator_type::propagate_on_container_swap::value || | |
93 | __is_nothrow_swappable<allocator_type>::value) && | |
94 | __is_nothrow_swappable<hasher>::value && | |
95 | __is_nothrow_swappable<key_equal>::value); | |
96 | ||
97 | hasher hash_function() const; | |
98 | key_equal key_eq() const; | |
99 | ||
100 | iterator find(const key_type& k); | |
101 | const_iterator find(const key_type& k) const; | |
102 | size_type count(const key_type& k) const; | |
103 | pair<iterator, iterator> equal_range(const key_type& k); | |
104 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; | |
105 | ||
106 | size_type bucket_count() const noexcept; | |
107 | size_type max_bucket_count() const noexcept; | |
108 | ||
109 | size_type bucket_size(size_type n) const; | |
110 | size_type bucket(const key_type& k) const; | |
111 | ||
112 | local_iterator begin(size_type n); | |
113 | local_iterator end(size_type n); | |
114 | const_local_iterator begin(size_type n) const; | |
115 | const_local_iterator end(size_type n) const; | |
116 | const_local_iterator cbegin(size_type n) const; | |
117 | const_local_iterator cend(size_type n) const; | |
118 | ||
119 | float load_factor() const noexcept; | |
120 | float max_load_factor() const noexcept; | |
121 | void max_load_factor(float z); | |
122 | void rehash(size_type n); | |
123 | void reserve(size_type n); | |
124 | }; | |
125 | ||
126 | template <class Key, class T, unsigned int Options = 0, class Hash = hash<Key>, class Pred = equal_to<Key>, | |
127 | class Allocator = allocator<pair<const Key, T> > > | |
128 | class hash_map | |
129 | { | |
130 | public: | |
131 | // types | |
132 | typedef Key key_type; | |
133 | typedef T mapped_type; | |
134 | typedef Hash hasher; | |
135 | typedef Pred key_equal; | |
136 | typedef Allocator allocator_type; | |
137 | typedef pair<const key_type, mapped_type> value_type; | |
138 | typedef value_type& reference; | |
139 | typedef const value_type& const_reference; | |
140 | typedef typename allocator_traits<allocator_type>::pointer pointer; | |
141 | typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; | |
142 | typedef typename allocator_traits<allocator_type>::size_type size_type; | |
143 | typedef typename allocator_traits<allocator_type>::difference_type difference_type; | |
144 | ||
145 | typedef /unspecified/ iterator; | |
146 | typedef /unspecified/ const_iterator; | |
147 | typedef /unspecified/ local_iterator; | |
148 | typedef /unspecified/ const_local_iterator; | |
149 | ||
150 | hash_map() | |
151 | noexcept( | |
152 | is_nothrow_default_constructible<hasher>::value && | |
153 | is_nothrow_default_constructible<key_equal>::value && | |
154 | is_nothrow_default_constructible<allocator_type>::value); | |
155 | explicit hash_map(size_type n, const hasher& hf = hasher(), | |
156 | const key_equal& eql = key_equal(), | |
157 | const allocator_type& a = allocator_type()); | |
158 | template <class InputIterator> | |
159 | hash_map(InputIterator f, InputIterator l, | |
160 | size_type n = 0, const hasher& hf = hasher(), | |
161 | const key_equal& eql = key_equal(), | |
162 | const allocator_type& a = allocator_type()); | |
163 | explicit hash_map(const allocator_type&); | |
164 | hash_map(const hash_map&); | |
165 | hash_map(const hash_map&, const Allocator&); | |
166 | hash_map(hash_map&&) | |
167 | noexcept( | |
168 | is_nothrow_move_constructible<hasher>::value && | |
169 | is_nothrow_move_constructible<key_equal>::value && | |
170 | is_nothrow_move_constructible<allocator_type>::value); | |
171 | hash_map(hash_map&&, const Allocator&); | |
172 | hash_map(initializer_list<value_type>, size_type n = 0, | |
173 | const hasher& hf = hasher(), const key_equal& eql = key_equal(), | |
174 | const allocator_type& a = allocator_type()); | |
175 | ~hash_map(); | |
176 | hash_map& operator=(const hash_map&); | |
177 | hash_map& operator=(hash_map&&) | |
178 | noexcept( | |
179 | allocator_type::propagate_on_container_move_assignment::value && | |
180 | is_nothrow_move_assignable<allocator_type>::value && | |
181 | is_nothrow_move_assignable<hasher>::value && | |
182 | is_nothrow_move_assignable<key_equal>::value); | |
183 | hash_map& operator=(initializer_list<value_type>); | |
184 | ||
185 | allocator_type get_allocator() const noexcept; | |
186 | ||
187 | bool empty() const noexcept; | |
188 | size_type size() const noexcept; | |
189 | size_type max_size() const noexcept; | |
190 | ||
191 | iterator begin() noexcept; | |
192 | iterator end() noexcept; | |
193 | const_iterator begin() const noexcept; | |
194 | const_iterator end() const noexcept; | |
195 | const_iterator cbegin() const noexcept; | |
196 | const_iterator cend() const noexcept; | |
197 | ||
198 | template <class... Args> | |
199 | pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args); | |
200 | template <class... Args> | |
201 | iterator emplace_hint(const_iterator position, BOOST_FWD_REF(Args)... args); | |
202 | pair<iterator, bool> insert(const value_type& obj); | |
203 | template <class P> | |
204 | pair<iterator, bool> insert(P&& obj); | |
205 | iterator insert(const_iterator hint, const value_type& obj); | |
206 | template <class P> | |
207 | iterator insert(const_iterator hint, P&& obj); | |
208 | template <class InputIterator> | |
209 | void insert(InputIterator first, InputIterator last); | |
210 | void insert(initializer_list<value_type>); | |
211 | ||
212 | iterator erase(const_iterator position); | |
213 | size_type erase(const key_type& k); | |
214 | iterator erase(const_iterator first, const_iterator last); | |
215 | void clear() noexcept; | |
216 | ||
217 | void swap(hash_map&) | |
218 | noexcept( | |
219 | (!allocator_type::propagate_on_container_swap::value || | |
220 | __is_nothrow_swappable<allocator_type>::value) && | |
221 | __is_nothrow_swappable<hasher>::value && | |
222 | __is_nothrow_swappable<key_equal>::value); | |
223 | ||
224 | hasher hash_function() const; | |
225 | key_equal key_eq() const; | |
226 | ||
227 | iterator find(const key_type& k); | |
228 | const_iterator find(const key_type& k) const; | |
229 | size_type count(const key_type& k) const; | |
230 | pair<iterator, iterator> equal_range(const key_type& k); | |
231 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; | |
232 | ||
233 | mapped_type& operator[](const key_type& k); | |
234 | mapped_type& operator[](key_type&& k); | |
235 | ||
236 | mapped_type& at(const key_type& k); | |
237 | const mapped_type& at(const key_type& k) const; | |
238 | ||
239 | size_type bucket_count() const noexcept; | |
240 | size_type max_bucket_count() const noexcept; | |
241 | ||
242 | size_type bucket_size(size_type n) const; | |
243 | size_type bucket(const key_type& k) const; | |
244 | ||
245 | local_iterator begin(size_type n); | |
246 | local_iterator end(size_type n); | |
247 | const_local_iterator begin(size_type n) const; | |
248 | const_local_iterator end(size_type n) const; | |
249 | const_local_iterator cbegin(size_type n) const; | |
250 | const_local_iterator cend(size_type n) const; | |
251 | ||
252 | float load_factor() const noexcept; | |
253 | float max_load_factor() const noexcept; | |
254 | void max_load_factor(float z); | |
255 | void rehash(size_type n); | |
256 | void reserve(size_type n); | |
257 | }; | |
258 | ||
259 | */ | |
260 | ||
261 | template <class Key, class Value, class KeyOfValue, unsigned int Options = 0, class Hash = hash<Key>, class Pred = equal_to<Key>, | |
262 | class Allocator = allocator<Value> > | |
263 | class hash_table | |
264 | { | |
265 | public: | |
266 | // types | |
267 | typedef Value key_type; | |
268 | typedef key_type value_type; | |
269 | typedef Hash hasher; | |
270 | typedef Pred key_equal; | |
271 | typedef Allocator allocator_type; | |
272 | typedef value_type& reference; | |
273 | typedef const value_type& const_reference; | |
274 | typedef typename allocator_traits<allocator_type>::pointer pointer; | |
275 | typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; | |
276 | typedef typename allocator_traits<allocator_type>::size_type size_type; | |
277 | typedef typename allocator_traits<allocator_type>::difference_type difference_type; | |
278 | ||
279 | typedef /unspecified/ iterator; | |
280 | typedef /unspecified/ const_iterator; | |
281 | typedef /unspecified/ local_iterator; | |
282 | typedef /unspecified/ const_local_iterator; | |
283 | ||
284 | hash_set() | |
285 | noexcept( | |
286 | is_nothrow_default_constructible<hasher>::value && | |
287 | is_nothrow_default_constructible<key_equal>::value && | |
288 | is_nothrow_default_constructible<allocator_type>::value); | |
289 | explicit hash_set(size_type n, const hasher& hf = hasher(), | |
290 | const key_equal& eql = key_equal(), | |
291 | const allocator_type& a = allocator_type()); | |
292 | template <class InputIterator> | |
293 | hash_set(InputIterator f, InputIterator l, | |
294 | size_type n = 0, const hasher& hf = hasher(), | |
295 | const key_equal& eql = key_equal(), | |
296 | const allocator_type& a = allocator_type()); | |
297 | explicit hash_set(const allocator_type&); | |
298 | hash_set(const hash_set&); | |
299 | hash_set(const hash_set&, const Allocator&); | |
300 | hash_set(hash_set&&) | |
301 | noexcept( | |
302 | is_nothrow_move_constructible<hasher>::value && | |
303 | is_nothrow_move_constructible<key_equal>::value && | |
304 | is_nothrow_move_constructible<allocator_type>::value); | |
305 | hash_set(hash_set&&, const Allocator&); | |
306 | hash_set(initializer_list<value_type>, size_type n = 0, | |
307 | const hasher& hf = hasher(), const key_equal& eql = key_equal(), | |
308 | const allocator_type& a = allocator_type()); | |
309 | ~hash_set(); | |
310 | hash_set& operator=(const hash_set&); | |
311 | hash_set& operator=(hash_set&&) | |
312 | noexcept( | |
313 | allocator_type::propagate_on_container_move_assignment::value && | |
314 | is_nothrow_move_assignable<allocator_type>::value && | |
315 | is_nothrow_move_assignable<hasher>::value && | |
316 | is_nothrow_move_assignable<key_equal>::value); | |
317 | hash_set& operator=(initializer_list<value_type>); | |
318 | ||
319 | allocator_type get_allocator() const noexcept; | |
320 | ||
321 | bool empty() const noexcept; | |
322 | size_type size() const noexcept; | |
323 | size_type max_size() const noexcept; | |
324 | ||
325 | iterator begin() noexcept; | |
326 | iterator end() noexcept; | |
327 | const_iterator begin() const noexcept; | |
328 | const_iterator end() const noexcept; | |
329 | const_iterator cbegin() const noexcept; | |
330 | const_iterator cend() const noexcept; | |
331 | ||
332 | template <class... Args> | |
333 | pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args); | |
334 | template <class... Args> | |
335 | iterator emplace_hint(const_iterator position, BOOST_FWD_REF(Args)... args); | |
336 | pair<iterator, bool> insert(const value_type& obj); | |
337 | pair<iterator, bool> insert(value_type&& obj); | |
338 | iterator insert(const_iterator hint, const value_type& obj); | |
339 | iterator insert(const_iterator hint, value_type&& obj); | |
340 | template <class InputIterator> | |
341 | void insert(InputIterator first, InputIterator last); | |
342 | void insert(initializer_list<value_type>); | |
343 | ||
344 | iterator erase(const_iterator position); | |
345 | size_type erase(const key_type& k); | |
346 | iterator erase(const_iterator first, const_iterator last); | |
347 | void clear() noexcept; | |
348 | ||
349 | void swap(hash_set&) | |
350 | noexcept( | |
351 | (!allocator_type::propagate_on_container_swap::value || | |
352 | __is_nothrow_swappable<allocator_type>::value) && | |
353 | __is_nothrow_swappable<hasher>::value && | |
354 | __is_nothrow_swappable<key_equal>::value); | |
355 | ||
356 | hasher hash_function() const; | |
357 | key_equal key_eq() const; | |
358 | ||
359 | iterator find(const key_type& k); | |
360 | const_iterator find(const key_type& k) const; | |
361 | size_type count(const key_type& k) const; | |
362 | pair<iterator, iterator> equal_range(const key_type& k); | |
363 | pair<const_iterator, const_iterator> equal_range(const key_type& k) const; | |
364 | ||
365 | size_type bucket_count() const noexcept; | |
366 | size_type max_bucket_count() const noexcept; | |
367 | ||
368 | size_type bucket_size(size_type n) const; | |
369 | size_type bucket(const key_type& k) const; | |
370 | ||
371 | local_iterator begin(size_type n); | |
372 | local_iterator end(size_type n); | |
373 | const_local_iterator begin(size_type n) const; | |
374 | const_local_iterator end(size_type n) const; | |
375 | const_local_iterator cbegin(size_type n) const; | |
376 | const_local_iterator cend(size_type n) const; | |
377 | ||
378 | float load_factor() const noexcept; | |
379 | float max_load_factor() const noexcept; | |
380 | void max_load_factor(float z); | |
381 | void rehash(size_type n); | |
382 | void reserve(size_type n); | |
383 | }; |