title: Why does std::vector::emplace call destructor without any copy constructor called?
body: <p>I am storing objects inside a <code>std::vector</code>, and I want to avoid calling destructor as much as possible.<br>
  I replaced copy constructor and assignments by move ones:</p>
  
  <pre><code>class Object
  {
      Object(const Object&amp;) = delete;
      Object(Object&amp;&amp;);
      Object&amp; operator=(const Object&amp;) = delete;
      Object&amp; operator=(Object&amp;&amp;);
      [...]
  };
  </code></pre>
  
  <p>I am initializing it like this:</p>
  
  <pre><code>std::vector&lt;Object&gt;   container;
  
  container.reserve(42) // Reserve a lot in order to be sure it won't be a problem
  </code></pre>
  
  <p>Then, I add two elements with <a href="http://www.cplusplus.com/reference/vector/vector/emplace_back/" rel="nofollow">emplace_back</a> (the constructor takes one <code>int</code> parameter):</p>
  
  <pre><code>container.emplace_back(1);
  container.emplace_back(3);
  </code></pre>
  
  <p>Until there, everything is fine. But then I want to insert an element before the last one with <a href="http://www.cplusplus.com/reference/vector/vector/emplace/" rel="nofollow">emplace</a>:</p>
  
  <pre><code>auto it = container.end();
  
  it--; // Last position.
  it--; // Before last position.
  container.emplace(it, 2);
  </code></pre>
  
  <p>But here a destructor is called.</p>
  
  <p>I tried to locate why with Valgrind, it appears <code>emplace</code> function calls <code>_M_insert_aux</code> that call my destructor.</p>
  
  <p>How could I avoid that?</p>