title: Using valid STATIC member function of class that can't be installed
body: <p>I have following piece of code:</p>
  
  <p>It compiles without problems under gcc-3.4, gcc-4.3, intel compiler, but fails under MSVC9.</p>
  
  <p>MSVC tells "use of undefined type <code>c_traits&lt;C&gt;</code>, while compiling class template member function <code>void foo&lt;C&gt;::go(void)</code> with C=short.</p>
  
  <p>The point it the compiler tries to install unused member function of unused class, because
  this class is just not used at all.</p>
  
  <p>I can work-around the issue by specializing entire class foo instead of specializing 
  its member function. But the point it that specializing entire class is little bit problematic for me for different reasons. </p>
  
  <p><strong>The big question:</strong> what is right?</p>
  
  <ul>
  <li>Is my code wrong and gcc and intel compiler just ignore the issue because they do not install foo fully, or</li>
  <li>The code is correct and this is bug of MSVC9 (VC 2008) that it tries to install unused member functions?</li>
  </ul>
  
  <p>The code:</p>
  
  <pre><code>class base_foo {
  public:
      virtual void go() {};
      virtual ~base_foo() {}
  };
  template&lt;typename C&gt;
  struct c_traits;
  
  template&lt;&gt;
  struct c_traits&lt;int&gt; {
      typedef unsigned int_type;
  };
  
  template&lt;typename C&gt;
  class foo : public base_foo {
  public:
      static base_foo *create()
      {
          return new foo&lt;C&gt;();
      }
      virtual void go() 
      {
          typedef typename c_traits&lt;C&gt;::int_type int_type;
          int_type i;
          i=1;
      }
  };
  
  template&lt;&gt;
  base_foo *foo&lt;short&gt;::create()
  {
      return new base_foo();
  }
  
  int main()
  {
      base_foo *a;
      a=foo&lt;short&gt;::create(); delete a;
      a=foo&lt;int&gt;::create(); delete a;
  }
  </code></pre>