title: templates of functions
body: <p>I'm told to create template of function , that will take 4 arguments :</p>
  
  <ul>
  <li>pointer</li>
  <li>reference</li>
  <li>pointer to array</li>
  <li>pointer to function</li>
  </ul>
  
  <p>How to perform this task ? I was trying :</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int nothing(int a)
  {
      return a;
  }
  
  template&lt;typename T&gt; T func(int *L, int &amp;M, char *K, int (*P)(int))
  {
      cout &lt;&lt; L &lt;&lt; "," &lt;&lt; M &lt;&lt; "," &lt;&lt; K[0] &lt;&lt; "," &lt;&lt; P() &lt;&lt; endl;
      return 0;    
  }
  
  int main()
  {
      int x = 3;
      int *z = &amp;x;
      int &amp;y = x;
      char c[3];
      int (*pf)(int) = nothing;
  
      cout &lt;&lt; "some result of func" &lt;&lt; func(z, y, c, pf) &lt;&lt; endl;
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>This gives me "no matching function , I guess for 'pf'. Also now I have no control over what to pass within pf or am I wrong ?</p>