43 typename PB_DS_CLASS_C_DEC::entry_allocator
44 PB_DS_CLASS_C_DEC::s_entry_allocator;
47 typename PB_DS_CLASS_C_DEC::value_allocator
48 PB_DS_CLASS_C_DEC::s_value_allocator;
51 typename PB_DS_CLASS_C_DEC::no_throw_copies_t
52 PB_DS_CLASS_C_DEC::s_no_throw_copies_ind;
58 copy_from_range(It first_it, It last_it)
60 while (first_it != last_it)
62 insert_value(*first_it, s_no_throw_copies_ind);
66 PB_DS_ASSERT_VALID((*
this))
72 : m_size(0), m_actual_size(resize_policy::min_size),
73 m_a_entries(s_entry_allocator.allocate(m_actual_size))
74 { PB_DS_ASSERT_VALID((*
this)) }
78 binary_heap(
const Cmp_Fn& r_cmp_fn)
79 : entry_cmp(r_cmp_fn), m_size(0), m_actual_size(resize_policy::min_size),
80 m_a_entries(s_entry_allocator.allocate(m_actual_size))
81 { PB_DS_ASSERT_VALID((*
this)) }
85 binary_heap(
const PB_DS_CLASS_C_DEC& other)
86 : entry_cmp(other), resize_policy(other), m_size(0),
87 m_actual_size(other.m_actual_size),
88 m_a_entries(s_entry_allocator.allocate(m_actual_size))
90 PB_DS_ASSERT_VALID(other)
91 _GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
95 copy_from_range(other.begin(), other.end());
99 for (size_type i = 0; i < m_size; ++i)
100 erase_at(m_a_entries, i, s_no_throw_copies_ind);
102 s_entry_allocator.deallocate(m_a_entries, m_actual_size);
103 __throw_exception_again;
105 PB_DS_ASSERT_VALID((*
this))
111 swap(PB_DS_CLASS_C_DEC& other)
113 PB_DS_ASSERT_VALID((*
this))
114 PB_DS_ASSERT_VALID(other)
115 _GLIBCXX_DEBUG_ASSERT(m_a_entries != other.m_a_entries);
117 std::swap((entry_cmp&)(*this), (entry_cmp&)other);
118 PB_DS_ASSERT_VALID((*this))
119 PB_DS_ASSERT_VALID(other)
125 value_swap(PB_DS_CLASS_C_DEC& other)
127 std::swap(m_a_entries, other.m_a_entries);
128 std::swap(m_size, other.m_size);
129 std::swap(m_actual_size, other.m_actual_size);
130 static_cast<resize_policy*
>(
this)->swap(other);
137 for (size_type i = 0; i < m_size; ++i)
138 erase_at(m_a_entries, i, s_no_throw_copies_ind);
139 s_entry_allocator.deallocate(m_a_entries, m_actual_size);