title: Why does the "size_of_array" template fucntion does not work with int a[n] (size defined at runtime) while it works fine with int a[4]?
body: <pre><code>template &lt;typename T, int n &gt;
  int tell_me_size(T (&amp;) [n]){
    return n;
  }
  </code></pre>
  <p>this code works fine with</p>
  <pre><code>int a[4];
  cout&lt;&lt; tell_me_size(a)&lt;&lt;endl;
  </code></pre>
  <p>while does not work with</p>
  <pre><code>int n;
  cin&gt;&gt;n;
  int a[n];
  cout&lt;&lt; tell_me_size(a)&lt;&lt;endl;
  </code></pre>
  <p>The later gives the error &quot;no matching function for call to ‘tell_me_size(int [n])&quot;</p>