title: In the declaration "std::vector<X> f();", is "std::vector<X>" an instantiation?
body: <p>The C++ Language Standard states the following concerning template components in the Standard Library:</p>
  
  <blockquote>
    <p>The effects are undefined...if an incomplete type is used as a template argument when instantiating a template component, unless specifically allowed for that component (C++11 §17.6.4.8/2).</p>
  </blockquote>
  
  <p>Does the following cause instantiation of the <code>std::vector</code> class template?</p>
  
  <pre><code>class X;
  std::vector&lt;X&gt; f(); // Declaration only; we will define it when X is complete
  </code></pre>
  
  <p>To ask it another way, in the function declaration <code>std::vector&lt;X&gt; f();</code>, is <code>std::vector</code> instantiated with the argument <code>X</code>?  Or, is <code>std::vector&lt;X&gt;</code> not instantiated until <code>f()</code> is odr-used or defined?</p>
  
  <p>Likewise, does the following cause instantiation of the <code>std::vector</code> class template?</p>
  
  <pre><code>class X;
  typedef std::vector&lt;X&gt; XVector; // We will complete X before we use XVector
  </code></pre>
  
  <p>While I use <code>std::vector</code> in these examples, the question applies equally to all templates.</p>