title: C++ static virtual members?
body: <p>Is it possible in C++ to have a member function that is both <code>static</code> and <code>virtual</code>? Apparently, there isn't a straightforward way to do it (<code>static virtual member();</code> is a compile error), but is there at least a way to achieve the same effect?</p>
  
  <p>I.E:</p>
  
  <pre><code>struct Object
  {
       struct TypeInformation;
  
       static virtual const TypeInformation &amp;GetTypeInformation() const;
  };
  
  struct SomeObject : public Object
  {
       static virtual const TypeInformation &amp;GetTypeInformation() const;
  };
  </code></pre>
  
  <p>It makes sense to use <code>GetTypeInformation()</code> both on an instance (<code>object-&gt;GetTypeInformation()</code>) and on a class (<code>SomeObject::GetTypeInformation()</code>), which can be useful for comparisons and vital for templates.</p>
  
  <p>The only ways I can think of involves writing two functions / a function and a constant, per class, or use macros.</p>
  
  <p>Any other solutions?</p>