title: C++ vector reference parameter
body: <p>let's say we have a class </p>
  
  <pre><code>class MyClass {
    vector&lt;vector&lt;int &gt; &gt; myMatrice;
  
  public :
    MyClass(vector&lt;vector&lt;int &gt; &gt; &amp;);
  }
  
  MyClass::MyClass(vector&lt;vector&lt;int &gt; &gt; &amp; m) {
    myMatrice = m;
  }
  </code></pre>
  
  <p>During the instanciation of MyClass, I pass a big vector &lt; vector &lt; int > > and I find that the object is actually copied and not only the reference, so it takes the double of the memory ...</p>
  
  <p>Please, can anyone help me out with this problem, I'm stuck since too many time ...</p>
  
  <p>And thanks a lot!</p>