title: Can't modify object vector in a class
body: <p>I'm trying to access an object in my vector and change some attributes, but it doesn't modify it. (Sorry for french code)</p>
  
  <pre><code> class Quincaillerie
   {
      vector&lt;Caisse&gt; vCaisses;
      public:
      Quincaillerie(int NBCaisse);
      vector&lt;Caisse&gt; GetCaisses() const { return vCaisses; }
   };
  </code></pre>
  
  <p>Here's the vector vCaisses that I want to access and change</p>
  
  <pre><code>class Caisse
  {
      int tempsFile;
      public:
      Caisse();
      int GetTempsFile() const { return tempsFile; }
      void AjouterTempsFile(int t) { tempsFile = t; }
  };
  </code></pre>
  
  <p>Here's the class</p>
  
  <pre><code>Caisse::Caisse() : tempsFile(0)
  {
  } 
  
  Quincaillerie::Quincaillerie(int NBCaisse) : vCaisses(NBCaisse, Caisse())
  {
  }
  </code></pre>
  
  <p>Now when I tried to do this</p>
  
  <pre><code>int main()
  {
      Quincaillerie Magasin(NBCAISSES);
      /****Here's the problem****/
      Magasin.GetCaisses().at(0).AjouterTempsFile(100);
      cout &lt;&lt; Magasin.GetCaisses().at(0).GetTempsFile() &lt;&lt; endl;
      /****Does not work****/
  }
  </code></pre>
  
  <p>It's suppose to cout 100, but cout 0</p>
  
  <p>Thanks for helping</p>