title: How to override static method of template class in derived class
body: <p>I'm having a little issue with overriding static methods of base clases, but the whole question is very complicated and too long (generalization of resource management in game engine), so here's a simplified version:</p>
  
  <pre><code>template&lt;class T&gt;
  class base
  {
      static void bar()
      { printf("bar"); }
  public:
      static void foo()
      { bar(); }
  };
  
  class derived : public base&lt;int&gt;
  {
      static void bar()
      { printf("baz"); }
  };
  
  int main() { derived::foo(); }
  </code></pre>
  
  <p>The code above outputs "bar" in my case, insted I want it to output "baz". How can I go about that? It seems that no matter what I attempt, base::foo() always calls base::bar(). I might have an issue with the design. I've never came across this problem - how can I resolve it?</p>