STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gp_ht_map_.hpp
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 // Copyright (C) 2005-2013 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 3, or (at your option) any later
9 // version.
10 
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
26 
27 // Permission to use, copy, modify, sell, and distribute this software
28 // is hereby granted without fee, provided that the above copyright
29 // notice appears in all copies, and that both that copyright notice
30 // and this permission notice appear in supporting documentation. None
31 // of the above authors, nor IBM Haifa Research Laboratories, make any
32 // representation about the suitability of this software for any
33 // purpose. It is provided "as is" without express or implied
34 // warranty.
35 
44 #include <ext/pb_ds/exception.hpp>
46 #include <utility>
47 #ifdef PB_DS_HT_MAP_TRACE_
48 #include <iostream>
49 #endif
50 #ifdef _GLIBCXX_DEBUG
52 #endif
53 #include <debug/debug.h>
54 
55 namespace __gnu_pbds
56 {
57  namespace detail
58  {
59 #ifdef PB_DS_DATA_TRUE_INDICATOR
60 #define PB_DS_GP_HASH_NAME gp_ht_map
61 #endif
62 
63 #ifdef PB_DS_DATA_FALSE_INDICATOR
64 #define PB_DS_GP_HASH_NAME gp_ht_set
65 #endif
66 
67 #define PB_DS_CLASS_T_DEC \
68  template<typename Key, typename Mapped, typename Hash_Fn, typename Eq_Fn, \
69  typename _Alloc, bool Store_Hash, typename Comb_Probe_Fn, \
70  typename Probe_Fn, typename Resize_Policy>
71 
72 #define PB_DS_CLASS_C_DEC \
73  PB_DS_GP_HASH_NAME<Key, Mapped, Hash_Fn, Eq_Fn, _Alloc, \
74  Store_Hash, Comb_Probe_Fn, Probe_Fn, Resize_Policy>
75 
76 #define PB_DS_HASH_EQ_FN_C_DEC \
77  hash_eq_fn<Key, Eq_Fn, _Alloc, Store_Hash>
78 
79 #define PB_DS_RANGED_PROBE_FN_C_DEC \
80  ranged_probe_fn<Key, Hash_Fn, _Alloc, Comb_Probe_Fn, Probe_Fn, Store_Hash>
81 
82 #define PB_DS_GP_HASH_TRAITS_BASE \
83  types_traits<Key, Mapped, _Alloc, Store_Hash>
84 
85 #ifdef _GLIBCXX_DEBUG
86 #define PB_DS_DEBUG_MAP_BASE_C_DEC \
87  debug_map_base<Key, Eq_Fn, \
88  typename _Alloc::template rebind<Key>::other::const_reference>
89 #endif
90 
91 
133  template<typename Key,
134  typename Mapped,
135  typename Hash_Fn,
136  typename Eq_Fn,
137  typename _Alloc,
138  bool Store_Hash,
139  typename Comb_Probe_Fn,
140  typename Probe_Fn,
141  typename Resize_Policy>
143 #ifdef _GLIBCXX_DEBUG
144  protected PB_DS_DEBUG_MAP_BASE_C_DEC,
145 #endif
146  public PB_DS_HASH_EQ_FN_C_DEC,
147  public Resize_Policy,
150  {
151  private:
153  typedef typename traits_base::value_type value_type_;
154  typedef typename traits_base::pointer pointer_;
155  typedef typename traits_base::const_pointer const_pointer_;
156  typedef typename traits_base::reference reference_;
157  typedef typename traits_base::const_reference const_reference_;
158  typedef typename traits_base::comp_hash comp_hash;
161  {
165  } __attribute__ ((packed));
166 
167  struct entry : public traits_base::stored_data_type
168  {
170  };
171 
172  typedef typename _Alloc::template rebind<entry>::other entry_allocator;
173  typedef typename entry_allocator::pointer entry_pointer;
174  typedef typename entry_allocator::const_pointer const_entry_pointer;
175  typedef typename entry_allocator::reference entry_reference;
176  typedef typename entry_allocator::const_reference const_entry_reference;
177  typedef typename entry_allocator::pointer entry_array;
178 
180 
181 #ifdef _GLIBCXX_DEBUG
182  typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
183 #endif
184 
186  typedef Resize_Policy resize_base;
187 
188 #define PB_DS_GEN_POS typename _Alloc::size_type
189 
194 
195 #undef PB_DS_GEN_POS
196 
197  public:
198  typedef _Alloc allocator_type;
199  typedef typename _Alloc::size_type size_type;
200  typedef typename _Alloc::difference_type difference_type;
201  typedef Hash_Fn hash_fn;
202  typedef Eq_Fn eq_fn;
203  typedef Probe_Fn probe_fn;
204  typedef Comb_Probe_Fn comb_probe_fn;
205  typedef Resize_Policy resize_policy;
206 
208  enum
209  {
210  store_hash = Store_Hash
211  };
212 
213  typedef typename traits_base::key_type key_type;
214  typedef typename traits_base::key_pointer key_pointer;
215  typedef typename traits_base::key_const_pointer key_const_pointer;
216  typedef typename traits_base::key_reference key_reference;
217  typedef typename traits_base::key_const_reference key_const_reference;
218  typedef typename traits_base::mapped_type mapped_type;
219  typedef typename traits_base::mapped_pointer mapped_pointer;
220  typedef typename traits_base::mapped_const_pointer mapped_const_pointer;
221  typedef typename traits_base::mapped_reference mapped_reference;
222  typedef typename traits_base::mapped_const_reference mapped_const_reference;
223  typedef typename traits_base::value_type value_type;
224  typedef typename traits_base::pointer pointer;
225  typedef typename traits_base::const_pointer const_pointer;
226  typedef typename traits_base::reference reference;
227  typedef typename traits_base::const_reference const_reference;
228 
229 #ifdef PB_DS_DATA_TRUE_INDICATOR
230  typedef point_iterator_ point_iterator;
231 #endif
232 
233 #ifdef PB_DS_DATA_FALSE_INDICATOR
234  typedef point_const_iterator_ point_iterator;
235 #endif
236 
238 
239 #ifdef PB_DS_DATA_TRUE_INDICATOR
240  typedef iterator_ iterator;
241 #endif
242 
243 #ifdef PB_DS_DATA_FALSE_INDICATOR
244  typedef const_iterator_ iterator;
245 #endif
246 
248 
250 
252 
253  PB_DS_GP_HASH_NAME(const Hash_Fn&);
254 
255  PB_DS_GP_HASH_NAME(const Hash_Fn&, const Eq_Fn&);
256 
257  PB_DS_GP_HASH_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&);
258 
259  PB_DS_GP_HASH_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&,
260  const Probe_Fn&);
261 
262  PB_DS_GP_HASH_NAME(const Hash_Fn&, const Eq_Fn&, const Comb_Probe_Fn&,
263  const Probe_Fn&, const Resize_Policy&);
264 
265  template<typename It>
266  void
267  copy_from_range(It, It);
268 
269  virtual
271 
272  void
274 
275  inline size_type
276  size() const;
277 
278  inline size_type
279  max_size() const;
280 
282  inline bool
283  empty() const;
284 
286  Hash_Fn&
287  get_hash_fn();
288 
290  const Hash_Fn&
291  get_hash_fn() const;
292 
294  Eq_Fn&
295  get_eq_fn();
296 
298  const Eq_Fn&
299  get_eq_fn() const;
300 
302  Probe_Fn&
303  get_probe_fn();
304 
306  const Probe_Fn&
307  get_probe_fn() const;
308 
310  Comb_Probe_Fn&
312 
314  const Comb_Probe_Fn&
315  get_comb_probe_fn() const;
316 
318  Resize_Policy&
320 
322  const Resize_Policy&
323  get_resize_policy() const;
324 
325  inline std::pair<point_iterator, bool>
327  {
328  _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid(__FILE__, __LINE__);)
329  return insert_imp(r_val, traits_base::m_store_extra_indicator);
330  }
331 
332  inline mapped_reference
334  {
335 #ifdef PB_DS_DATA_TRUE_INDICATOR
336  return subscript_imp(r_key, traits_base::m_store_extra_indicator);
337 #else
338  insert(r_key);
339  return traits_base::s_null_type;
340 #endif
341  }
342 
343  inline point_iterator
345 
346  inline point_const_iterator
347  find(key_const_reference) const;
348 
349  inline point_iterator
350  find_end();
351 
352  inline point_const_iterator
353  find_end() const;
354 
355  inline bool
357 
358  template<typename Pred>
359  inline size_type
360  erase_if(Pred);
361 
362  void
363  clear();
364 
365  inline iterator
366  begin();
367 
368  inline const_iterator
369  begin() const;
370 
371  inline iterator
372  end();
373 
374  inline const_iterator
375  end() const;
376 
377 #ifdef _GLIBCXX_DEBUG
378  void
379  assert_valid(const char*, int) const;
380 #endif
381 
382 #ifdef PB_DS_HT_MAP_TRACE_
383  void
384  trace() const;
385 #endif
386 
387  private:
388 #ifdef PB_DS_DATA_TRUE_INDICATOR
389  friend class iterator_;
390 #endif
391 
392  friend class const_iterator_;
393 
394  void
395  deallocate_all();
396 
397  void
398  initialize();
399 
400  void
402 
403  inline bool
405 
406  inline void
408 
409  void
411 
412  virtual void
414 
415  void
417 
418  inline void
420 
421  inline void
423 
424  inline size_type
426 
427  inline comp_hash
429 
430  inline std::pair<point_iterator, bool>
432 
433  inline std::pair<point_iterator, bool>
435 
436  inline pointer
438  {
440 
441  if (do_resize_if_needed())
442  pos = find_ins_pos(PB_DS_V2F(r_val),
443  traits_base::m_store_extra_indicator);
444 
446  entry* const p_e = m_entries + pos;
447  new (&p_e->m_value) value_type(r_val);
448  p_e->m_stat = valid_entry_status;
449  resize_base::notify_inserted(++m_num_used_e);
450 
451  _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(p_e->m_value));)
452  _GLIBCXX_DEBUG_ONLY(assert_valid(__FILE__, __LINE__);)
453  return &p_e->m_value;
454  }
455 
456  inline pointer
457  insert_new_imp(const_reference r_val, comp_hash& r_pos_hash_pair)
458  {
459  _GLIBCXX_DEBUG_ASSERT(m_entries[r_pos_hash_pair.first].m_stat !=
461 
462  if (do_resize_if_needed())
463  r_pos_hash_pair = find_ins_pos(PB_DS_V2F(r_val),
464  traits_base::m_store_extra_indicator);
465 
466  _GLIBCXX_DEBUG_ASSERT(m_entries[r_pos_hash_pair.first].m_stat !=
468 
469  entry* const p_e = m_entries + r_pos_hash_pair.first;
470  new (&p_e->m_value) value_type(r_val);
471  p_e->m_hash = r_pos_hash_pair.second;
472  p_e->m_stat = valid_entry_status;
473 
474  resize_base::notify_inserted(++m_num_used_e);
475 
476  _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(p_e->m_value));)
477  _GLIBCXX_DEBUG_ONLY(assert_valid(__FILE__, __LINE__);)
478  return &p_e->m_value;
479  }
480 
481 #ifdef PB_DS_DATA_TRUE_INDICATOR
482  inline mapped_reference
483  subscript_imp(key_const_reference key, false_type)
484  {
485  _GLIBCXX_DEBUG_ONLY(assert_valid(__FILE__, __LINE__);)
486 
487  const size_type pos = find_ins_pos(key,
488  traits_base::m_store_extra_indicator);
489 
490  entry_pointer p_e = &m_entries[pos];
491  if (p_e->m_stat != valid_entry_status)
492  return insert_new_imp(value_type(key, mapped_type()), pos)->second;
493 
495  return p_e->m_value.second;
496  }
497 
498  inline mapped_reference
499  subscript_imp(key_const_reference key, true_type)
500  {
501  _GLIBCXX_DEBUG_ONLY(assert_valid(__FILE__, __LINE__);)
502 
503  comp_hash pos_hash_pair = find_ins_pos(key,
504  traits_base::m_store_extra_indicator);
505 
506  if (m_entries[pos_hash_pair.first].m_stat != valid_entry_status)
507  return insert_new_imp(value_type(key, mapped_type()),
508  pos_hash_pair)->second;
509 
511  return (m_entries + pos_hash_pair.first)->m_value.second;
512  }
513 #endif
514 
515  inline pointer
517  {
518  const size_type hash = ranged_probe_fn_base::operator()(key);
519  resize_base::notify_find_search_start();
520 
521  // Loop until entry is found or until all possible entries accessed.
522  for (size_type i = 0; i < m_num_e; ++i)
523  {
524  const size_type pos = ranged_probe_fn_base::operator()(key,
525  hash, i);
526 
527  entry* const p_e = m_entries + pos;
528  switch (p_e->m_stat)
529  {
530  case empty_entry_status:
531  {
532  resize_base::notify_find_search_end();
534  return 0;
535  }
536  break;
537  case valid_entry_status:
538  if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), key))
539  {
540  resize_base::notify_find_search_end();
542  return pointer(&p_e->m_value);
543  }
544  break;
545  case erased_entry_status:
546  break;
547  default:
549  };
550 
551  resize_base::notify_find_search_collision();
552  }
553 
555  resize_base::notify_find_search_end();
556  return 0;
557  }
558 
559  inline pointer
561  {
562  comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(key);
563  resize_base::notify_find_search_start();
564 
565  // Loop until entry is found or until all possible entries accessed.
566  for (size_type i = 0; i < m_num_e; ++i)
567  {
568  const size_type pos =
569  ranged_probe_fn_base::operator()(key, pos_hash_pair.second, i);
570 
571  entry* const p_e = m_entries + pos;
572 
573  switch(p_e->m_stat)
574  {
575  case empty_entry_status:
576  {
577  resize_base::notify_find_search_end();
579  return 0;
580  }
581  break;
582  case valid_entry_status:
583  if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value),
584  p_e->m_hash,
585  key, pos_hash_pair.second))
586  {
587  resize_base::notify_find_search_end();
589  return pointer(&p_e->m_value);
590  }
591  break;
592  case erased_entry_status:
593  break;
594  default:
596  };
597 
598  resize_base::notify_find_search_collision();
599  }
600 
602  resize_base::notify_find_search_end();
603  return 0;
604  }
605 
606  inline bool
607  erase_imp(key_const_reference, true_type);
608 
609  inline bool
611 
612  inline void
614 
615 #ifdef PB_DS_DATA_TRUE_INDICATOR
616  void
617  inc_it_state(pointer& r_p_value, size_type& r_pos) const
618  { inc_it_state((mapped_const_pointer& )r_p_value, r_pos); }
619 #endif
620 
621  void
622  inc_it_state(const_pointer& r_p_value, size_type& r_pos) const
623  {
624  _GLIBCXX_DEBUG_ASSERT(r_p_value != 0);
625  for (++r_pos; r_pos < m_num_e; ++r_pos)
626  {
627  const_entry_pointer p_e =& m_entries[r_pos];
628  if (p_e->m_stat == valid_entry_status)
629  {
630  r_p_value =& p_e->m_value;
631  return;
632  }
633  }
634  r_p_value = 0;
635  }
636 
637  void
638  get_start_it_state(const_pointer& r_p_value, size_type& r_pos) const
639  {
640  for (r_pos = 0; r_pos < m_num_e; ++r_pos)
641  {
642  const_entry_pointer p_e = &m_entries[r_pos];
643  if (p_e->m_stat == valid_entry_status)
644  {
645  r_p_value = &p_e->m_value;
646  return;
647  }
648  }
649  r_p_value = 0;
650  }
651 
652  void
654  {
655  for (r_pos = 0; r_pos < m_num_e; ++r_pos)
656  {
657  entry_pointer p_e = &m_entries[r_pos];
658  if (p_e->m_stat == valid_entry_status)
659  {
660  r_p_value = &p_e->m_value;
661  return;
662  }
663  }
664  r_p_value = 0;
665  }
666 
667 #ifdef _GLIBCXX_DEBUG
668  void
669  assert_entry_array_valid(const entry_array, false_type,
670  const char*, int) const;
671 
672  void
673  assert_entry_array_valid(const entry_array, true_type,
674  const char*, int) const;
675 #endif
676 
678  static iterator s_end_it;
680 
684 
685  enum
686  {
687  store_hash_ok = !Store_Hash
688  || !is_same<Hash_Fn, __gnu_pbds::null_type>::value
689  };
690 
692  };
693 
704 
705 #undef PB_DS_CLASS_T_DEC
706 #undef PB_DS_CLASS_C_DEC
707 #undef PB_DS_HASH_EQ_FN_C_DEC
708 #undef PB_DS_RANGED_PROBE_FN_C_DEC
709 #undef PB_DS_GP_HASH_TRAITS_BASE
710 #undef PB_DS_DEBUG_MAP_BASE_C_DEC
711 #undef PB_DS_GP_HASH_NAME
712  } // namespace detail
713 } // namespace __gnu_pbds
void get_start_it_state(pointer &r_p_value, size_type &r_pos)
Definition: gp_ht_map_.hpp:653
Resize_Policy resize_policy
Definition: gp_ht_map_.hpp:205
Hash_Fn hash_fn
Definition: gp_ht_map_.hpp:201
Probe_Fn & get_probe_fn()
Return current probe_fn.
void swap(PB_DS_CLASS_C_DEC &)
traits_base::const_reference const_reference_
Definition: gp_ht_map_.hpp:157
void get_start_it_state(const_pointer &r_p_value, size_type &r_pos) const
Definition: gp_ht_map_.hpp:638
_Alloc::size_type size_type
Definition: gp_ht_map_.hpp:199
traits_base::const_pointer const_pointer
Definition: gp_ht_map_.hpp:225
entry_allocator::pointer entry_array
Definition: gp_ht_map_.hpp:177
#define PB_DS_RANGED_PROBE_FN_C_DEC
Definition: gp_ht_map_.hpp:79
traits_base::const_reference const_reference
Definition: gp_ht_map_.hpp:227
_Alloc::difference_type difference_type
Definition: gp_ht_map_.hpp:200
point_iterator find(key_const_reference)
PB_DS_RANGED_PROBE_FN_C_DEC ranged_probe_fn_base
Definition: gp_ht_map_.hpp:179
traits_base::mapped_pointer mapped_pointer
Definition: gp_ht_map_.hpp:219
traits_base::const_pointer const_pointer_
Definition: gp_ht_map_.hpp:155
void resize_imp_reassign(entry_pointer, entry_array, false_type)
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
pointer insert_new_imp(const_reference r_val, size_type pos)
Definition: gp_ht_map_.hpp:437
traits_base::pointer pointer
Definition: gp_ht_map_.hpp:224
Eq_Fn eq_fn
Definition: gp_ht_map_.hpp:202
#define _GLIBCXX_DEBUG_ONLY(_Statement)
Definition: debug.h:63
Hash_Fn & get_hash_fn()
Return current hash_fn.
Resize_Policy & get_resize_policy()
Return current resize_policy.
_Alloc allocator_type
Definition: gp_ht_map_.hpp:198
mapped_reference operator[](key_const_reference r_key)
Definition: gp_ht_map_.hpp:333
entry_allocator::const_reference const_entry_reference
Definition: gp_ht_map_.hpp:176
static iterator s_end_it
Definition: gp_ht_map_.hpp:678
traits_base::value_type value_type_
Definition: gp_ht_map_.hpp:153
traits_base::key_const_pointer key_const_pointer
Definition: gp_ht_map_.hpp:215
traits_base::pointer pointer_
Definition: gp_ht_map_.hpp:154
Definition: gp_ht_map_.hpp:167
size_type m_num_used_e
Definition: gp_ht_map_.hpp:682
_Alloc::template rebind< entry >::other entry_allocator
Definition: gp_ht_map_.hpp:172
traits_base::key_const_reference key_const_reference
Definition: gp_ht_map_.hpp:217
PB_DS_GP_HASH_TRAITS_BASE traits_base
Definition: gp_ht_map_.hpp:152
#define PB_DS_HASH_EQ_FN_C_DEC
Definition: gp_ht_map_.hpp:76
traits_base::key_reference key_reference
Definition: gp_ht_map_.hpp:216
return(unsigned int) __res
bool erase_imp(key_const_reference, true_type)
static const_iterator s_const_end_it
Definition: gp_ht_map_.hpp:679
static entry_allocator s_entry_allocator
Definition: gp_ht_map_.hpp:677
Probe_Fn probe_fn
Definition: gp_ht_map_.hpp:203
traits_base::mapped_const_pointer mapped_const_pointer
Definition: gp_ht_map_.hpp:220
#define PB_DS_GP_HASH_TRAITS_BASE
Definition: gp_ht_map_.hpp:82
Definition: gp_ht_map_.hpp:142
PB_DS_HASH_EQ_FN_C_DEC hash_eq_fn_base
Definition: gp_ht_map_.hpp:185
Comb_Probe_Fn comb_probe_fn
Definition: gp_ht_map_.hpp:204
void inc_it_state(const_pointer &r_p_value, size_type &r_pos) const
Definition: gp_ht_map_.hpp:622
#define PB_DS_CLASS_C_DEC
Definition: gp_ht_map_.hpp:72
traits_base::value_type value_type
Definition: gp_ht_map_.hpp:223
traits_base::reference reference
Definition: gp_ht_map_.hpp:226
entry_allocator::reference entry_reference
Definition: gp_ht_map_.hpp:175
Eq_Fn & get_eq_fn()
Return current eq_fn.
traits_base::reference reference_
Definition: gp_ht_map_.hpp:156
point_const_iterator_ point_const_iterator
Definition: gp_ht_map_.hpp:237
const_iterator_ const_iterator
Definition: gp_ht_map_.hpp:247
virtual void do_resize(size_type)
entry_pointer m_entries
Definition: gp_ht_map_.hpp:683
Const range-type iterator.
Definition: const_iterator.hpp:43
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
entry_allocator::pointer entry_pointer
Definition: gp_ht_map_.hpp:173
pointer find_key_pointer(key_const_reference key, false_type)
Definition: gp_ht_map_.hpp:516
size_type m_num_e
Definition: gp_ht_map_.hpp:681
Find type iterator.
Definition: point_iterator.hpp:43
Comb_Probe_Fn & get_comb_probe_fn()
Return current comb_probe_fn.
Resize_Policy resize_base
Definition: gp_ht_map_.hpp:186
traits_base::comp_hash comp_hash
Definition: gp_ht_map_.hpp:158
#define PB_DS_CHECK_KEY_EXISTS(_Key)
Definition: container_base_dispatch.hpp:55
traits_base::key_type key_type
Definition: gp_ht_map_.hpp:213
entry_allocator::const_pointer const_entry_pointer
Definition: gp_ht_map_.hpp:174
bool erase(key_const_reference)
bool empty() const
True if size() == 0.
void erase_all_valid_entries(entry_array, size_type)
Range-type iterator.
Definition: iterator.hpp:43
entry_status m_stat
Definition: gp_ht_map_.hpp:169
traits_base::key_pointer key_pointer
Definition: gp_ht_map_.hpp:214
std::pair< point_iterator, bool > insert_imp(const_reference, false_type)
#define PB_DS_V2F(X)
Definition: container_base_dispatch.hpp:80
pointer find_key_pointer(key_const_reference key, true_type)
Definition: gp_ht_map_.hpp:560
traits_base::mapped_reference mapped_reference
Definition: gp_ht_map_.hpp:221
entry_status
Definition: gp_ht_map_.hpp:160
Const point-type iterator.
Definition: point_const_iterator.hpp:45
__gnu_pbds::detail::PB_DS_GP_HASH_NAME::entry __attribute__
traits_base::mapped_const_reference mapped_const_reference
Definition: gp_ht_map_.hpp:222
std::pair< point_iterator, bool > insert(const_reference r_val)
Definition: gp_ht_map_.hpp:326
traits_base::mapped_type mapped_type
Definition: gp_ht_map_.hpp:218
#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)
Definition: container_base_dispatch.hpp:58
pointer insert_new_imp(const_reference r_val, comp_hash &r_pos_hash_pair)
Definition: gp_ht_map_.hpp:457
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71
size_type find_ins_pos(key_const_reference, false_type)