title: pop_back and erase for a vector class C++
body: <p>I'm trying to write the pop_back and erase member functions for my vector class. However I realized I can not use delete. Any suggestions for how I can get rid of an element? </p>
  
  <pre><code>template &lt;class T&gt;
  class Vector{
  private:
  int current_size, capacity;
  T* arr;
  
  public:
  
  Vector();
  unsigned int size();
  void grow();
  void push_back(const T&amp; elt);
  void pop_back();
  T&amp; at(int pos);
  T&amp; front();
  T&amp; back();
  bool empty();
  void insert (const T&amp;elt, int pos);
  void erase(int pos);
  Vector&lt;T&gt;&amp; operator=(const Vector&amp; v);
  T&amp; operator[](int n);
  
  };
  
  template &lt;class T&gt;
  void Vector&lt;T&gt;::pop_back(){
  if(!empty()){
      delete arr[current_size-1];
      current_size--;
      }
   }
  
  template &lt;class T&gt;
  void Vector&lt;T&gt;::erase(int pos){
  if(!empty() &amp;&amp; pos&gt;=0 &amp;&amp; pos&lt;current_size) {
      for (int i=pos; i&lt;(current_size-1); i++){
          arr[i]=arr[i+1];
      }
      delete arr[current_size-1];
      current_size--;
   }
  }
  </code></pre>