title: Constructor issue in for-loop
body: <p>Suppose I have a class <em>A</em>. I want to create few objects of type <em>A</em> and push them into a vector. There are many ways to do so, in particular the two illustrated below.<br>
  The first uses a for-loop, the second does not.</p>
  
  <p>Apparently they should be equivalent, however if I print <em>this</em> in the constructor of the new objects, those within the loop share the same address.
  I expected </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  class A {
      public:
          A();
          ~A();
  };
  
  
  A::A() {
      std::cout &lt;&lt; "this = " &lt;&lt; this &lt;&lt; std::endl;
  }
  
  A::~A() {}
  
  int main() {
  
      std::vector&lt;A&gt; v;
  
      // Way 1 (with for loop)
      for (unsigned i = 1; i &lt;= 2; i++)
          v.push_back(A());
  
      // WAY 2 (without for)
      v.push_back(A());
      v.push_back(A());
  
      return 0;
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>this = 0x7ffe8ac35ef9     &lt;- these two are the same
  this = 0x7ffe8ac35ef9     &lt;- 
  this = 0x7ffe8ac35efa
  this = 0x7ffe8ac35efb
  </code></pre>
  
  <p>What am I overlooking?</p>