title: Detecting if type is a function
body: <pre><code>template&lt;class T&gt;
  struct IsFunc
  {
      typedef char one;
      typedef struct 
      {
          char dummy_[2];
      } two;
  
      static one f(...);
  
      static two f(T (*)[1]);
      enum {value = (sizeof(f&lt;T&gt;(0)) == 1)};
  };
  </code></pre>
  
  <p>And if I try to run it in main:</p>
  
  <pre><code>void functionA();
      int _tmain(int argc, _TCHAR* argv[])
      {
          int a = 0;
          cout &lt;&lt; IsFunc&lt;functionA&gt;::value;//&lt;=--------HERE
  
          return 0;
      }
  </code></pre>
  
  <p>I'm getting an error:<br>
  <strong>Error 1   error C2923: 'IsFunc' : 'functionA' is not a valid template type</strong><br>
  What am I doing wrong?<br>
  Thanks</p>