title: Declaring a static method in a class that overrides a virtual one in C++
body: <p>I would like to have an abstract base class with the virtual method getInstance and some classes that inherit from it (all of them are singleton) to implement this method as static.
  The code would be something along the lines of this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Father
  {
  public:
    virtual Father* getInstance();
  protected:
    static Father* instance;
  };
  
  class Son : public Father
  {
  public:
    static Father* getInstance ()
    {
      if (instance == 0)
        instance = new Son();
  
      return instance;
    }
  
  private:
    Son();
  };
  
  
  int main ()
  {
    Father* son = Son::getInstance();
  }
  </code></pre>
  
  <p>But the compiler won't let me override the getInstance method as static.
  Is there any other way to do this?</p>