title: c++ check function is overloaded or not in runtime
body: <p>I have an abstract interface <code>I</code> in which <code>virtual void Foo()</code> is defined, along with other functions. There are some subclasses in which <code>Foo</code> is re-defined, and others in which <code>Foo</code> is not. Now, given <code>I* pi</code>, is it possible to know whether <code>Foo</code> is re-defined? That is, I want to know whether  <code>pi-&gt;Foo()</code> would call <code>I::Foo()</code> or <code>X::Foo()</code> where <code>X</code> is some type in which <code>Foo</code> is re-defined. I think this can be done by comparing function pointers, between <code>&amp;I::Foo</code> and <code>&amp;pi-&gt;Foo</code>, but not sure exactly how to. Note that I don't know the concrete type of <code>pi</code> in runtime, so I cannot compare function pointers directly by <code>&amp;I::Foo != &amp;X::Foo</code>.</p>
  
  <p>ADD:
  So, a lot of people pointed that the design is bad, against the concept of abstraction and virtual functions. The main reason that I'm doing this is to bypass empty function calls to improve speed. Since some of <code>Foo()</code> are empty, I would like to remove it from a vector of <code>pi</code>s, when <code>Foo()</code> is empty.</p>