title: std::vector pop_back() implementation
body: <p>I have just started with my Data Structures and I am implementing some sort of arrayed list (~=std::vector). I was wondering how is pop_back() implemented so that it has constant complexity? It has to reduce the size by 1 and delete the last element. Now I saw somewhere that it basically reduces the size by 1 and destroys last element via some iterator/pointer, but then why couldn't we implement pop_front() the same way and just redirect our pointer to first element to the next one?</p>
  
  <pre><code>template &lt;typename T&gt;
  ArrayList&lt;T&gt;&amp; ArrayList&lt;T&gt;::pop_back()
  {
      --size_;
      auto p = new T[size_];
      std::copy(elements_,elements_+size_,p);
      delete [] elements_;   //elements_ being my pointer
      elements_ = p;
      return *this;
  }
  </code></pre>