title: Difference between instantiation and specialization in c++ templates
body: <p>What is the difference between specialization and instantiation in context of C++ templates. From what I have read so far the following is what I have understood about specialization and instantiation.</p>
  
  <pre><code>template &lt;typename T&gt;
  struct Struct
  {
  
       T x;
  };
  
  template&lt;&gt;
  struct Struct &lt;int&gt; //specialization
  {
  
      //code
  };
  
  int main()
  {
     Struct &lt;int&gt; s; //specialized version comes into play
     Struct &lt;float&gt; r; // Struct &lt;float&gt; is instantiated by the compiler as shown below
  
  }
  </code></pre>
  
  <p>Instantiation of <code>Struct &lt;float&gt;</code> by the compiler</p>
  
  <pre><code>template &lt;typename T=float&gt;
  struct Struct
  {
      float x;
  }
  </code></pre>
  
  <p>Is my understanding of template instantiation and specialization correct?</p>