Again, for exception safety, take a look at http://www.stroustrup.com/except.pdf
it uses a vector implementation as example.
template <typename T>
T* temp = new T[capacity_ * 2]; //(a)
for(unsigned int i = 0; i < size_; i++)
*(temp + i) = *(data + i); //(b)
data = temp;
capacity_ *= 2;
std::cout << e.what() << "\n";
std::cout << "Reallocation successful.\n";
Lines (a) and (b) may thrown an exception.
If (b) also throws `bad_alloc' you may not be able to tell which one are you catching.
For (b) you need to deallocate the buffer, and destroy all the objects that were `created'.
Edit: as you are not using placement new, all the objects are already constructed.
I suppose that you could simply
which will release everything properly. (you'll need to increase `temp' scope)
By the way, ¿why the `*(temp+i)' obfuscation?