title: How to make a list of functions in C++?
body: <p>I want to make a list of function, but the push_back doesn't work, can someone tell me why?</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;list&gt;
      using namespace std;
      void * f(int numeraccio) {
          numeraccio++;
          cout &lt;&lt; " " &lt;&lt; numeraccio &lt;&lt; " " &lt;&lt; endl;
      };
  
  
     int main()
  {
  
      list&lt;void(*)(int )&gt; l;
      l.push_back(f);
      getchar();
  
      return 0;
  }
  </code></pre>
  
  <p>I get this error </p>
  
  <pre><code>Error C2664 'void std::list&lt;void (__cdecl       *)(int),std::allocator&lt;_Ty&gt;&gt;::push_back(const _Ty &amp;)': impossible to convert the argument 1 from 'void *(int)' to 'void (__cdecl *&amp;&amp;)(int)' 
  </code></pre>