Call one of a member function pointer inside a struct
<p>I have this following struct</p>

<pre><code>typedef struct      s_ins
{
  std::string       item;
  int               extended;
  void              (CPU::*fc)(std::list&lt;std::string&gt; &amp;list&gt;;
}                  t_ins;
</code></pre>

<p>Then I declare an array, where my tokens need to be redirected in a function</p>

<pre><code>t_ins     g_ins[] =                                                                                       
{                                                                                                         
  {"push", 1, &amp;CPU::ins_push},                                                                            
  {"pop", 0, &amp;CPU::ins_pop},                                                                              
  {"dump", 0, &amp;CPU::ins_dump},                                                                            
  {"assert", 1, &amp;CPU::ins_assert},                                                                        
  {"add", 0, &amp;CPU::ins_add},                                                                              
  {"sub", 0, &amp;CPU::ins_sub},                                                                              
  {"mul", 0, &amp;CPU::ins_mul},                                                                              
  {"div", 0, &amp;CPU::ins_div},                                                                              
  {"mod", 0, &amp;CPU::ins_mod},                                                                              
  {"print", 0, &amp;CPU::ins_print},                                                                          
  {"exit", 0, &amp;CPU::ins_exit},                                                                           
  {"", 0, 0}                                                                                             
};
</code></pre>

<p>Finally this is how I call it (in a CPU function member) :</p>

<pre><code>(*g_ins[i].fc)(tokens);
</code></pre>

<p>what I get is :</p>

<pre><code>cpu.cpp: In member function ‘void CPU::get_instruction(std::list&lt;std::basic_string&lt;char&gt; &gt;&amp;)’:
cpu.cpp:40:16: error: invalid use of unary ‘*’ on pointer to member
</code></pre>

<p>I tried many others way to call it, but I still have some errors.
This is how I think :
I access my function with g_ins[i].fc, tell him that it's a function member pointer with the *, and pass my parameters. I use it in a function of the same class of the function member pointer so I don't need to have a object before since it's 'this' right ?</p>

<p>Thanks</p>
