title: What happens when using pass by reference and member initialization lists in C++ classes?
body: <p>Okay, so I have a large vector say </p>
  
  <pre><code>vector&lt;vector&lt;vector&lt;int&gt;&gt;&gt; 
  </code></pre>
  
  <p>of 10000 by 10000 by 10000. </p>
  
  <p>I have a class which has  such a vector as a private member variable:</p>
  
  <pre><code>class foo {
  private:
  vector&lt;vector&lt;vector&lt;int&gt;&gt;&gt; myvector
  };
  </code></pre>
  
  <p>I have a constructor for my class that uses pass by reference and initializer list:</p>
  
  <pre><code>foo(vector&lt;vector&lt;vector&lt;int&gt;&gt;&gt; &amp;myvector_in) : myvector(myvector_in);
  </code></pre>
  
  <p>I want to know what's exactly happening in terms of memory usage. Is the private myvector the same as the one that was originally declared, or is it a copy. </p>
  
  <p>Basically, I want to know if there are ever two version of myvector in memory.</p>
  
  <p>Thank You!</p>