title: Vector's push_back implementation using memcpy
body: <p>Given the following push_back code:</p>
  
  <pre><code>template &lt;typename T&gt;
  void Vector&lt;T&gt;::push_back(const T&amp; item) {
  
  if (_size == _capacity) {
      _capacity = _capacity + (_capacity &gt; 1 ? (_capacity / 2) : 1);
      T* newVec = new T[_capacity];
      memcpy(newVec, _ptr, _size*(sizeof(T)));
      delete [] _ptr;
      _ptr = newVec;
  }
  _ptr[_size++] = item;
  }
  </code></pre>
  
  <p>While the vector's class contain these members:</p>
  
  <pre><code>T*  _ptr;
  size_t _size;
  size_t _capacity;
  </code></pre>
  
  <p>Is that implementation safe..? Will memcpy do his job correctly even if T is polymorphic type?</p>
  
  <p>Would love to hear some suggestions about how to improve the implementation.</p>