title: C++ STL datastructures compared to Java
body: <p>I'm currently learning C++ and trying to get used to the standard data structures that come with it, but they all seem very bare.  For example, list doesn't have simple accessors like get(index) that I'm used to in Java.  Methods like pop_back and pop_front don't return the object in the list either.  So you have to do something like:</p>
  
  <pre><code>Object blah = myList.back();
  myList.pop_back();
  </code></pre>
  
  <p>Instead of something simple like:
  <code>Object blah = myList.pop_back();</code></p>
  
  <p>In Java, just about every data structure returns the object back so you don't have to make these extra calls.  Why is the STL containers for C++ designed like this?  Are common operations like this that I do in Java not so common for C++?</p>
  
  <p>edit: Sorry, I guess my question was worded very poorly to get all these downvotes, but surely somebody could have edited it.  To clarify, I'm wondering why the STL data structures are created like this in comparison to Java.  Or am I using the wrong set of data structures to begin with?  My point is that these seem like common operations you might use on (in my example) a list and surely everybody does not want to write their own implementation each time.</p>
  
  <p>edit: reworded the question to be more clear.</p>