195 if ((
size_type)(m_capacity - m_begin) < s)
198 T* newBegin = AllocatorT::allocate(s);
203 AllocatorT::construct(newBegin + i, m_begin[i]);
204 AllocatorT::destroy(m_begin + i);
206 AllocatorT::deallocate(m_begin,
capacity());
208 m_end = newBegin + olds;
210 m_capacity = m_begin + s;
234 if ((
size_type)(m_capacity - m_begin) >= s)
238 T* newBegin = AllocatorT::allocate(s);
240 for (
size_type i = 0; i < copyRange; ++i)
242 AllocatorT::construct(newBegin + i, m_begin[i]);
243 AllocatorT::destroy(m_begin + i);
247 AllocatorT::destroy(m_begin + i);
251 AllocatorT::construct(newBegin + i, v);
253 AllocatorT::deallocate(m_begin,
capacity());
254 m_end = newBegin + s;
256 m_capacity = m_begin + s;
261 AllocatorT::construct(m_begin + i, v);
265 AllocatorT::destroy(m_begin + i);
271 T* newBegin = AllocatorT::allocate(newCapacity);
276 AllocatorT::construct(newBegin + i, m_begin[i]);
277 AllocatorT::destroy(m_begin + i);
279 AllocatorT::deallocate(m_begin,
capacity());
282 AllocatorT::construct(newBegin + i, v);
289 AllocatorT::construct(newBegin + i, v);
292 m_end = newBegin + s;
294 m_capacity = m_begin + newCapacity;
356 if (m_end >= m_capacity)
364 T* newBegin = AllocatorT::allocate(s);
369 AllocatorT::construct(newBegin + i, m_begin[i]);
370 AllocatorT::destroy(m_begin + i);
372 AllocatorT::deallocate(m_begin,
capacity());
374 m_end = newBegin + olds;
376 m_capacity = m_begin + s;
378 AllocatorT::construct(m_end, v);
386 if (m_end >= m_capacity)
394 T* newBegin = AllocatorT::allocate(s);
399 AllocatorT::construct(newBegin + i, m_begin[i]);
400 AllocatorT::destroy(m_begin + i);
402 AllocatorT::deallocate(m_begin,
capacity());
404 m_end = newBegin + olds;
406 m_capacity = m_begin + s;
407 where = m_begin + whereIdx;
409 if (
size() > whereIdx)
411 AllocatorT::construct(m_end, m_begin[
size() - 1]);
414 m_begin[i] = m_begin[i - 1];
420 AllocatorT::construct(where, v);
430 m_begin[i] = m_begin[i + 1];
433 AllocatorT::destroy(m_end);
437 T* newBegin = AllocatorT::allocate(
size());
440 AllocatorT::construct(newBegin + i, m_begin[i]);
441 AllocatorT::destroy(m_begin + i);
443 AllocatorT::deallocate(m_begin,
capacity());
444 m_end = newBegin + s;
446 m_capacity = m_begin + s;
454 AllocatorT::destroy(m_end);
458 T* newBegin = AllocatorT::allocate(
size());
461 AllocatorT::construct(newBegin + i, m_begin[i]);
462 AllocatorT::destroy(m_begin + i);
464 AllocatorT::deallocate(m_begin,
capacity());
465 m_end = newBegin + s;
467 m_capacity = m_begin + s;