The T destructor is called (and not the destructor ArrayList<T>), and this is probably because objects of type T created in a pre-allocated array and not individually on the heap using a specialplacement new operator
Therefore, when one is deleted, there is no need to release any memory, but you want to call the destructor so that the state is cleared.
. (, std::vector) . : void* operator new (std::size_t size, void* ptr) throw();
, , delete , , , .
AFAIK, , dtor
, , , :
std:: copy :
template<class InputIterator, class OutputIterator>
OutputIterator copy (InputIterator first, InputIterator last, OutputIterator result)
{
while (first!=last) {
*result = *first;
++result; ++first;
}
return result;
}
, = .
+ 1. , , .
, , , .
. , , ++ 11 std:: copy (, boost::move)
2. location > index, .