title: Get index of object inserted into a vector
body: <p>How can I get the position where my object was actually inserted?</p>
  
  <pre><code>#include &lt;vector&gt;
  using namespace std;
  
  vector&lt;SomeClass&gt; list;
  SomeClass object;
  list.push_back(object);
  
  list[...].method(); // I do not have the key
  </code></pre>
  
  <p>Unfortunately <code>push_back</code> does not return anything since its return type is <code>void</code>.</p>