How do I create an array of method pointers in C++?
<p>How do I create an array of method pointers in C++?</p>

<p>The problem is, although these methods have the same signature, they are in different classes.
Those classes inherit from one same class.</p>

<p>For example:</p>

<pre><code>class A : public Base {
    virtual bool work();
}

class B : public Base {
    virtual bool work();
}
</code></pre>

<p>And I need to create an array of pointers to the methods A::work and B::work, in
another class.</p>

<p>Edit 1:</p>

<p>I decided to go with Useless's suggestion, option 1:</p>

<pre><code>vector&lt;Base*&gt; units;
Base *a = new A();
Base *b = new B();
units.push_back(a);
units.push_back(b);
</code></pre>

<p>Thanks</p>
