title: Issue with class template partial specialization
body: <p>I've been trying to implement a function that needs partial template specializations and fallen back to the static struct technique, and I'm having a number of problems.</p>
  
  <pre><code>            template&lt;typename T&gt; struct PushImpl&lt;const T&amp;&gt; {
                  typedef T* result_type;
                  typedef const T&amp; argument_type;
                  template&lt;int StackSize&gt; static result_type Push(IStack&lt;StackSize&gt;* sptr, argument_type ref) {
                  // Code if the template is T&amp;
                  }
              };
              template&lt;typename T&gt; struct PushImpl&lt;const T*&gt; {
                  typedef T* result_type;
                  typedef const T* argument_type;
                  template&lt;int StackSize&gt; static result_type Push(IStack&lt;StackSize&gt;* sptr, argument_type ptr) {
                      return PushImpl&lt;const T&amp;&gt;::Push(sptr, *ptr);
                  }
              };
              template&lt;typename T&gt; struct PushImpl {
                  typedef T* result_type;
                  typedef const T&amp; argument_type;
                  template&lt;int StackSize&gt; static result_type Push(IStack&lt;StackSize&gt;* sptr, argument_type ref) {
                  // Code if the template is neither T* nor T&amp;
                  }
              };
  
              template&lt;typename T&gt; typename PushImpl&lt;T&gt;::result_type Push(typename PushImpl&lt;T&gt;::argument_type ref) {
                  return PushImpl&lt;T&gt;::Push(this, ref);
              }
  </code></pre>
  
  <p>First: The struct is nested inside another class (the one that offers Push as a member func), but it can't access the template parameter (StackSize), even though my other nested classes all could. I've worked around it, but it would be cleaner if they could just access StackSize like a normal class.</p>
  
  <p>Second: The compiler complains that it doesn't use or can't deduce T. Really?</p>
  
  <p>Thirdly: The compiler complains that it can't specialize a template in the current scope (class scope).</p>
  
  <p>I can't see what the problem is. Have I accidentally invoked some bad syntax?</p>