46 for (size_type i = 0; i < m_size; ++i)
47 erase_at(m_a_entries, i, s_no_throw_copies_ind);
51 const size_type new_size = resize_policy::get_new_size_for_arbitrary(0);
52 entry_pointer new_entries = s_entry_allocator.allocate(new_size);
53 resize_policy::notify_arbitrary(new_size);
54 s_entry_allocator.deallocate(m_a_entries, m_actual_size);
55 m_actual_size = new_size;
56 m_a_entries = new_entries;
68 erase_at(entry_pointer a_entries, size_type i,
false_type)
70 a_entries[i]->~value_type();
71 s_value_allocator.deallocate(a_entries[i], 1);
77 erase_at(entry_pointer, size_type,
true_type)
89 erase_at(m_a_entries, m_size - 1, s_no_throw_copies_ind);
90 resize_for_erase_if_needed();
98 template<typename Pred>
105 typedef typename entry_pred<value_type, Pred, _Alloc, simple_value>::type
108 const size_type left = partition(pred_t(pred));
110 const size_type ersd = m_size - left;
111 for (size_type i = left; i < m_size; ++i)
112 erase_at(m_a_entries, i, s_no_throw_copies_ind);
116 const size_type new_size =
117 resize_policy::get_new_size_for_arbitrary(left);
119 entry_pointer new_entries = s_entry_allocator.allocate(new_size);
120 std::copy(m_a_entries, m_a_entries + left, new_entries);
121 s_entry_allocator.deallocate(m_a_entries, m_actual_size);
122 m_actual_size = new_size;
123 resize_policy::notify_arbitrary(m_actual_size);
137 erase(point_iterator it)
142 const size_type fix_pos = it.m_p_e - m_a_entries;
143 std::
swap(*it.m_p_e, m_a_entries[m_size - 1]);
144 erase_at(m_a_entries, m_size - 1, s_no_throw_copies_ind);
145 resize_for_erase_if_needed();
151 if (fix_pos != m_size)
152 fix(m_a_entries + fix_pos);
160 resize_for_erase_if_needed()
162 if (!resize_policy::resize_needed_for_shrink(m_size))
167 const size_type new_size = resize_policy::get_new_size_for_shrink();
168 entry_pointer new_entries = s_entry_allocator.allocate(new_size);
169 resize_policy::notify_shrink_resize();
172 std::copy(m_a_entries, m_a_entries + m_size - 1, new_entries);
173 s_entry_allocator.deallocate(m_a_entries, m_actual_size);
174 m_actual_size = new_size;
175 m_a_entries = new_entries;
182 template<
typename Pred>
183 typename PB_DS_CLASS_C_DEC::size_type
188 size_type right = m_size - 1;
190 while (right + 1 != left)
194 if (!pred(m_a_entries[left]))
196 else if (pred(m_a_entries[right]))
201 std::swap(m_a_entries[left], m_a_entries[right]);
#define __try
Definition: exception_defines.h:35
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
#define PB_DS_CLASS_C_DEC
Definition: bin_search_tree_.hpp:71
#define PB_DS_CLASS_T_DEC
Definition: bin_search_tree_.hpp:67
return(unsigned int) __res
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
#define __catch(X)
Definition: exception_defines.h:36
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
void swap(exception_ptr &__lhs, exception_ptr &__rhs)
Definition: exception_ptr.h:160
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71