title: Using SFINAE to detect a member function
body: <p>In C++11, to find out whether a class has a member function <code>size</code>, you could define the following test helper:</p>
  
  <pre><code>template &lt;typename T&gt;
  struct has_size_fn
  {
      typedef char (&amp; yes)[1];
      typedef char (&amp; no)[2];
  
      template &lt;typename C&gt; static yes check(decltype(&amp;C::size));
      template &lt;typename&gt; static no check(...);
  
      static bool const value = sizeof(check&lt;T&gt;(0)) == sizeof(yes);
  };
  </code></pre>
  
  <p>Is there a similar trick for doing this in C++98 without relying on compiler extensions such as <code>typeof</code>?</p>