title: Inserting into a std::vector at an index via the assignment operator
body: <p>I'm new to C++ and am curious if this is the preferred way of inserting into a std::vector</p>
  
  <pre><code>std::vector&lt;Object_I_madeup&gt; myVector;
  
     void setAt(int x, Object_I_madeup o)
          {
              myVector[x] = o;
  
          } // set the array location at x  to be o.
  </code></pre>
  
  <p>I ask because I see a lot of things about using <code>push_back</code>,or the highly confusing <code>insert()</code>. Is this Java-like way valid? I'd much rather do that...</p>