title: Partial specialisation of member function with non-type parameter
body: <p>I have a template class with both a type and a non-type template parameter. I want to specialize a member function, what I finding is, as in the example below, I can do a full specialization fine.</p>
  
  <pre><code>template&lt;typename T, int R&gt;
  struct foo
  {
      foo(const T&amp; v) :
          value_(v)
      {}
  
      void bar()
      {
          std::cout &lt;&lt; "Generic" &lt;&lt; std::endl;
          for (int i = 0; i &lt; R; ++i)
              std::cout &lt;&lt; value_ &lt;&lt; std::endl;
      }
  
      T value_;
  };
  
  template&lt;&gt;
  void foo&lt;float, 3&gt;::bar()
  {
      std::cout &lt;&lt; "Float" &lt;&lt; std::endl;
      for (int i = 0; i &lt; 3; ++i)
          std::cout &lt;&lt; value_ &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>However this partial specialization won't compile.</p>
  
  <pre><code>template&lt;int R&gt;
  void foo&lt;double, R&gt;::bar()
  {
      std::cout &lt;&lt; "Double" &lt;&lt; std::endl;
      for (int i = 0; i &lt; R; ++i)
          std::cout &lt;&lt; value_ &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Is there a way to achieve what I'm attempting would anyone know? I tried this in MSVC 2010.</p>