title: C++ 2D vector clear works as intended?
body: <p>I want to make sure that the following works as I intend without memory leaks:</p>
  
  <pre><code>vector&lt;vector &lt;float&gt; &gt; X;
  for (int i = 0; i &lt; some_size; i++)
  {
       vector&lt;float&gt; column;
       X.push_back(column);
  }
  // ... use 2D array somehow
  X.clear(); 
  /* CALLS DESTRUCTOR OF EACH ELEMENT, BUT SINCE EACH ELEMENT
  IS A VECTOR, CLEAR IS RECURSIVELY CALLED ON EACH OF THOSE*/
  </code></pre>
  
  <p>That is, is <code>clear()</code> recursively applied to vectors of vectors due to <code>clear</code> being part of a vector's destructor?</p>
  
  <p>I know <code>X</code> is cleared fully when it goes out of scope but that is not the point of the question here.</p>