43 inline typename PB_DS_CLASS_C_DEC::comp_hash
45 find_ins_pos(key_const_reference r_key,
true_type)
47 PB_DS_ASSERT_VALID((*
this))
48 comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(r_key);
55 size_type ins_pos = m_num_e;
56 resize_base::notify_insert_search_start();
57 for (i = 0; i < m_num_e; ++i)
59 const size_type pos = ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
61 entry*
const p_e = m_entries + pos;
64 case empty_entry_status:
66 resize_base::notify_insert_search_end();
67 PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
69 return ((ins_pos == m_num_e) ?
74 case erased_entry_status:
75 if (ins_pos == m_num_e)
78 case valid_entry_status:
79 if (hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash,
80 r_key, pos_hash_pair.second))
82 resize_base::notify_insert_search_end();
83 PB_DS_CHECK_KEY_EXISTS(r_key)
88 _GLIBCXX_DEBUG_ASSERT(0);
90 resize_base::notify_insert_search_collision();
92 resize_base::notify_insert_search_end();
93 if (ins_pos == m_num_e)
94 __throw_insert_error();
101 insert_imp(const_reference r_val,
true_type)
103 key_const_reference r_key = PB_DS_V2F(r_val);
104 comp_hash pos_hash_pair = find_ins_pos(r_key,
105 traits_base::m_store_extra_indicator);
107 _GLIBCXX_DEBUG_ASSERT(pos_hash_pair.first < m_num_e);
108 entry_pointer p_e =& m_entries[pos_hash_pair.first];
109 if (p_e->m_stat == valid_entry_status)
111 PB_DS_CHECK_KEY_EXISTS(r_key)
115 PB_DS_CHECK_KEY_DOES_NOT_EXIST(r_key)
116 return std::make_pair(insert_new_imp(r_val, pos_hash_pair),
true);
Struct holding two objects of arbitrary type.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > make_pair(_T1 &&__x, _T2 &&__y)
A convenience wrapper for creating a pair from two objects.