title: Difference between `vector<int> v;` and `vector<int> v = vector<int>();`
body: <p>What is the difference between</p>
  
  <pre><code>std::vector&lt;int&gt; v;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>std::vector&lt;int&gt; v = std::vector&lt;int&gt;();
  </code></pre>
  
  <p>Intuitively, I would never use the second version but I am not sure if there is any difference. It feels to me that the second line is simply a default constructor building a temporary object that is then moved by a move assignment operator.</p>
  
  <p>I am wondering whether the second line is not somehow equivalent to </p>
  
  <pre><code>std::vector&lt;int&gt; v = *(new std::vector&lt;int&gt;()); 
  </code></pre>
  
  <p>hence causing the vector itself to be on the heap (dynamically allocated). If it is the case, then the first line would probably be preferred for most cases.</p>
  
  <p><strong>How do these lines of code differ?</strong></p>