title: C++ - Template function call operator overload - Error C2064
body: <p>I'm trying to overload function call operator in c++ and I got this compilation error that I cannot resolve (Visual Studio 2010).</p>
  
  <p>Error is in line <code>act(4);</code></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  
  void Test(int i);
  template &lt;class T&gt; class Action
  {
      private:
          void (*action)(T);
      public:
          Action(void (*action)(T))
          {
              this-&gt;action = action;
          }
          void Invoke(T arg)
          {
              this-&gt;action(arg);
          }
          void operator()(T arg)
          {
              this-&gt;action(arg);
          }
  };
  
  int main()
  {
      Action&lt;int&gt; *act = new Action&lt;int&gt;(Test);
      act-&gt;Invoke(5);
      act(4);     //error C2064: term does not evaluate to a function taking 1 arguments overload
      char c;
      std::cin &gt;&gt; c;
  
      return 0;
  }
  
  void Test(int i)
  {
      std::cout &lt;&lt; i;
  }
  </code></pre>