Not sure if I'm doing this right. Do I really need to create a separate pointer to point to dynamic arrays?
1 2 3 4 5 6 7
T* temp = new T[capacity_ * 2];
T* tIter = &temp; //Do these need to be here?
T* dIter = &data; //Or can I use *(temp + i) and *(data + i)?
(forunsignedint i = 0; i < size_; i++)
{
*(tIter + i) = *(dIter + i);
}
It seems like new calling the default constructor is a real hassle. Is there a reason new doesn't just set aside space for n elements, and have me add elements as I choose (for arrays of course)?