24 #ifndef PPL_Swapping_Vector_inlines_hh
25 #define PPL_Swapping_Vector_inlines_hh 1
27 #include "assertions.hh"
62 if (impl.capacity() < new_capacity) {
64 std::vector<T> new_impl;
67 new_impl.resize(impl.size());
73 swap(new_impl[i], impl[i]);
85 impl.resize(new_size);
92 impl.resize(new_size, x);
101 template <
typename T>
104 return impl.capacity();
107 template <
typename T>
113 template <
typename T>
120 template <
typename T>
126 template <
typename T>
132 template <
typename T>
138 template <
typename T>
144 template <
typename T>
151 template <
typename T>
157 template <
typename T>
162 for (
const_iterator i = begin(), i_end = end(); i != i_end; ++i) {
163 n += i->external_memory_in_bytes();
168 template <
typename T>
174 template <
typename T>
180 template <
typename T>
186 template <
typename T>
192 template <
typename T>
195 PPL_ASSERT(itr >= begin());
196 PPL_ASSERT(itr < end());
200 while (i != size()) {
201 swap(impl[i-1], impl[i]);
204 return begin() + old_i;
207 template <
typename T>
210 PPL_ASSERT(begin() <= first);
211 PPL_ASSERT(first <= last);
212 PPL_ASSERT(last <= end());
214 typedef typename std::iterator_traits<iterator>::difference_type diff_t;
215 const diff_t k = last - first;
219 swap(*first, *(first + k));
221 impl.erase(end() - k, end());
225 template <
typename T>
228 return impl.max_size();
231 template <
typename T>
240 #endif // !defined(PPL_Swapping_Vector_inlines_hh)
dimension_type max_num_rows()
void swap(CO_Tree &x, CO_Tree &y)
iterator erase(iterator itr)
size_t dimension_type
An unsigned integral type for representing space dimensions.
void resize(dimension_type new_size)
void m_swap(Swapping_Vector &v)
dimension_type capacity() const
T & operator[](dimension_type i)
dimension_type compute_capacity(dimension_type requested_size, dimension_type maximum_size)
Speculative allocation function.
void push_back(const T &x)
void swap(Swapping_Vector< T > &vec1, Swapping_Vector< T > &vec2)
std::vector< T >::iterator iterator
void reserve(dimension_type new_capacity)
The entire library is confined to this namespace.
std::vector< T >::const_iterator const_iterator
memory_size_type external_memory_in_bytes() const
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
dimension_type size() const