42#ifdef PB_DS_CLASS_C_DEC
45inline typename PB_DS_CLASS_C_DEC::comp_hash
47find_ins_pos(key_const_reference r_key, true_type)
49 PB_DS_ASSERT_VALID((*
this))
50 comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
57 size_type ins_pos = m_num_e;
58 resize_base::notify_insert_search_start();
59 for (i = 0; i < m_num_e; ++i)
61 const size_type pos = ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
63 entry*
const p_e = m_entries + pos;
66 case empty_entry_status:
68 resize_base::notify_insert_search_end();
69 PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
71 return ((ins_pos == m_num_e) ?
72 std::make_pair(pos, pos_hash_pair.second) :
73 std::make_pair(ins_pos, pos_hash_pair.second));
76 case erased_entry_status:
77 if (ins_pos == m_num_e)
80 case valid_entry_status:
81 if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
82 r_key, pos_hash_pair.second))
84 resize_base::notify_insert_search_end();
85 PB_DS_CHECK_KEY_EXISTS(r_key)
86 return std::make_pair(pos, pos_hash_pair.second);
90 _GLIBCXX_DEBUG_ASSERT(0);
92 resize_base::notify_insert_search_collision();
94 resize_base::notify_insert_search_end();
95 if (ins_pos == m_num_e)
96 __throw_insert_error();
97 return std::make_pair(ins_pos, pos_hash_pair.second);
103insert_imp(const_reference r_val, true_type)
105 key_const_reference r_key = PB_DS_V2F(r_val);
106 comp_hash pos_hash_pair = find_ins_pos(r_key,
107 traits_base::m_store_extra_indicator);
109 _GLIBCXX_DEBUG_ASSERT(pos_hash_pair.first < m_num_e);
110 entry_pointer p_e =& m_entries[pos_hash_pair.first];
111 if (p_e->m_stat == valid_entry_status)
113 PB_DS_CHECK_KEY_EXISTS(r_key)
114 return std::make_pair(&p_e->m_value,
false);
117 PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
118 return std::make_pair(insert_new_imp(r_val, pos_hash_pair),
true);
ISO C++ entities toplevel namespace is std.
Struct holding two objects of arbitrary type.