41 #ifdef PB_DS_CLASS_C_DEC
45 typename PB_DS_CLASS_C_DEC::point_iterator,
48 insert(const_reference r_val)
50 PB_DS_ASSERT_VALID((*
this))
51 entry_pointer p_l = find_imp(PB_DS_V2F(r_val));
55 PB_DS_CHECK_KEY_EXISTS(PB_DS_V2F(r_val))
56 return std::make_pair(point_iterator(&p_l->m_value),
false);
59 PB_DS_CHECK_KEY_DOES_NOT_EXIST(PB_DS_V2F(r_val))
61 p_l = allocate_new_entry(r_val, traits_base::m_no_throw_copies_indicator);
62 p_l->m_p_next = m_p_l;
64 PB_DS_ASSERT_VALID((*
this))
65 return
std::
make_pair(point_iterator(&p_l->m_value), true);
69 inline typename PB_DS_CLASS_C_DEC::entry_pointer
71 allocate_new_entry(const_reference r_val,
false_type)
73 entry_pointer p_l = s_entry_allocator.allocate(1);
74 cond_dealtor_t cond(p_l);
75 new (
const_cast<void*
>(
static_cast<const void*
>(&p_l->m_value)))
79 _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
80 init_entry_metadata(p_l, s_metadata_type_indicator);
85 inline typename PB_DS_CLASS_C_DEC::entry_pointer
87 allocate_new_entry(const_reference r_val,
true_type)
89 entry_pointer p_l = s_entry_allocator.allocate(1);
90 new (&p_l->m_value) value_type(r_val);
91 _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(r_val));)
92 init_entry_metadata(p_l, s_metadata_type_indicator);
97 template<
typename Metadata>
100 init_entry_metadata(entry_pointer p_l, type_to_type<Metadata>)
101 {
new (&p_l->m_update_metadata) Metadata(s_update_policy()); }
106 init_entry_metadata(entry_pointer, type_to_type<null_type>)
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false 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.
ISO C++ entities toplevel namespace is std.
Struct holding two objects of arbitrary type.