Passing void(*) in C++
<p>I have a std::map which I'm trying to store void pointers for the values. The problem is, most of the pointer I'm trying to store are methods in a class and have different amount of params. I know for the params I can use a va list so thats not too much of a problem, the problem would be the actual pointer itself.</p>

<p>This is what I have:</p>

<pre><code>class A 
{
public:
  A();
  void methodA(...);
};
class B
{
public:
  B();
  void methodB(...);
};
void method_no_class(...) { }

std::map&lt;int, void(*)(...)&gt; my_map;

my_map[0] = &amp;method_no_class;
B* cb = new B();
my_map[1] = &amp;cb-&gt;methodB; // will return error
</code></pre>
