42 template<
typename Pred>
50 typename entry_pred<value_type, Pred, _Alloc, simple_value>::type
53 const size_type left = partition(pred_t(pred));
56 const size_type ersd = m_size - left;
59 const size_type new_size = resize_policy::get_new_size_for_arbitrary(left);
60 const size_type other_actual_size = other.get_new_size_for_arbitrary(ersd);
62 entry_pointer a_entries = 0;
63 entry_pointer a_other_entries = 0;
67 a_entries = s_entry_allocator.allocate(new_size);
68 a_other_entries = s_entry_allocator.allocate(other_actual_size);
73 s_entry_allocator.deallocate(a_entries, new_size);
75 if (a_other_entries != 0)
76 s_entry_allocator.deallocate(a_other_entries, other_actual_size);
81 for (size_type i = 0; i < other.m_size; ++i)
82 erase_at(other.m_a_entries, i, s_no_throw_copies_ind);
85 std::copy(m_a_entries, m_a_entries + left, a_entries);
86 std::copy(m_a_entries + left, m_a_entries + m_size, a_other_entries);
88 s_entry_allocator.deallocate(m_a_entries, m_actual_size);
89 s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
91 m_actual_size = new_size;
92 other.m_actual_size = other_actual_size;
97 m_a_entries = a_entries;
98 other.m_a_entries = a_other_entries;
103 resize_policy::notify_arbitrary(m_actual_size);
104 other.notify_arbitrary(other.m_actual_size);
118 const size_type len = m_size + other.m_size;
119 const size_type new_size = resize_policy::get_new_size_for_arbitrary(len);
121 entry_pointer a_entries = 0;
122 entry_pointer a_other_entries = 0;
126 a_entries = s_entry_allocator.allocate(new_size);
127 a_other_entries = s_entry_allocator.allocate(resize_policy::min_size);
132 s_entry_allocator.deallocate(a_entries, new_size);
134 if (a_other_entries != 0)
135 s_entry_allocator.deallocate(a_other_entries, resize_policy::min_size);
140 std::copy(m_a_entries, m_a_entries + m_size, a_entries);
141 std::copy(other.m_a_entries, other.m_a_entries + other.m_size,
144 s_entry_allocator.deallocate(m_a_entries, m_actual_size);
145 m_a_entries = a_entries;
147 m_actual_size = new_size;
148 resize_policy::notify_arbitrary(new_size);
151 s_entry_allocator.deallocate(other.m_a_entries, other.m_actual_size);
152 other.m_a_entries = a_other_entries;
154 other.m_actual_size = resize_policy::min_size;
155 other.notify_arbitrary(resize_policy::min_size);
#define __try
Definition: exception_defines.h:35
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
#define __throw_exception_again
Definition: exception_defines.h:37
#define PB_DS_CLASS_C_DEC
Definition: bin_search_tree_.hpp:71
#define PB_DS_CLASS_T_DEC
Definition: bin_search_tree_.hpp:67
#define __catch(X)
Definition: exception_defines.h:36
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324