title: std::list remove element by index
body: <p>I have a std::list full of objects. Whenever I add a object, I want to store that objects index in the list, so later on I can remove it from the list.</p>
  
  <p>What I want to do in pseudo code</p>
  
  <pre><code>myList.pushBack(element);
  int index = myList.getIndexOfLastElement();
  
  myList.erase(index);
  </code></pre>
  
  <p>For performance reasons I can't search by value.</p>
  
  <p><strong>To clarify:</strong>
  I have element a(index 0), b(index 1), c(index 2), d(index 3)</p>
  
  <p>If I delete element b, I still want to be able to access c by 2.</p>