| 240 | //------------------------------------------------------------------------ |
| 241 | template<class T> |
| 242 | void pod_vector<T>::resize(unsigned new_size) |
| 243 | { |
| 244 | if(new_size > m_size) |
| 245 | { |
| 246 | if(new_size > m_capacity) |
| 247 | { |
| 248 | T* data = pod_allocator<T>::allocate(new_size); |
| 249 | memcpy(data, m_array, m_size * sizeof(T)); |
| 250 | pod_allocator<T>::deallocate(m_array, m_capacity); |
| 251 | m_array = data; |
| 252 | } |
| 253 | } |
| 254 | else |
| 255 | { |
| 256 | m_size = new_size; |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | //------------------------------------------------------------------------ |
| 261 | template<class T> pod_vector<T>::pod_vector(unsigned cap, unsigned extra_tail) : |
no outgoing calls
no test coverage detected