title: C++ - Could not deduce template argument
body: <p>I have a sample code which makes use of template programming, it runs fine on linux. But when I try to bring it to windows with visual studio 12, I got compile error about template argument deduction. Here is the fraction of code that cause the error:</p>
  
  <pre><code>template &lt;int I&gt;
  class assign_array
  {
  public:
      template &lt;typename U, unsigned N&gt;
      static inline void run(improved_builtin&lt;U, N&gt;&amp; a, const U b[N])
      {
          // do sth
      }
  };
  
  template &lt;template &lt;int&gt; class A, int I, int E&gt;
  struct loop_iter
  {
      template &lt;typename U, typename V&gt;
      static inline void iter(U&amp; a, V&amp; b)
      {
         A&lt;I&gt;::run(a, b); // get error here
      }
  };
  
  template &lt;typename T, unsigned N&gt;
  improved_builtin&lt;T, N&gt;::improved_builtin(const T v[N])
  {
      loop_iter&lt;assign_array, 0, N - 1&gt;::iter(*this, v);
      return;
  }
  </code></pre>
  
  <p>The error occurs at A::run(a, b) => assign_array&lt;0>::run(improved_builtin &amp;,const U [N])' : could not deduce template argument for 'const U [N]' from 'const int *'</p>
  
  <p>And I have noticed something strange in the error message which is improved_builtin. In the assign_array class, the signature of the first argument should be improved_builtin. I have no idea why US appears there. Anyone has any idea about this error?</p>