title: How to use c++20 concepts to match a generics member function of a class
body: <p>I have a template class Foo, include a generics function calc which can accept any ARGS</p>
  <pre><code>template &lt;class RET&gt;
  struct Foo
  {
      template&lt;class ...ARGS&gt;
      RET calc(ARGS &amp;&amp;...args)
      {
          // do some thing...
          ((std::cout&lt;&lt;&quot;, &quot;&lt;&lt;std::forward&lt;ARGS&gt;(args)), ...) &lt;&lt;std::endl;
          return defaultRet;
      }
  
      RET defaultRet;
  };
  
  int main () {
      auto ret = Foo&lt;int&gt;(42).calc(1,2,3); // print &quot;1, 2, 3&quot;
      std::cout&lt;&lt; ret &lt;&lt;std::endl;        // print &quot;42&quot;
      return 0;
  }
  </code></pre>
  <p>Then I want to write a concepts <code>Calcable</code> to match <code>Foo</code>. And <code>Bar::calc</code> return <code>void</code>, so <code>Calcable&lt;Bar&lt;int&gt;&gt;</code> should be <code>false</code></p>
  <p>But I cannot write the <code>Calcable</code>, I'm crazy!</p>
  <pre><code>template &lt;class RET&gt;
  struct Foo
  {
      template&lt;class ...ARGS&gt;
      RET calc(ARGS &amp;&amp;...args)
      {
          // do some thing...
          ((std::cout&lt;&lt;&quot;, &quot;&lt;&lt;std::forward&lt;ARGS&gt;(args)), ...) &lt;&lt;std::endl;
          return defaultRet;
      }
  
      RET defaultRet;
  };
  
  template &lt;class RET&gt;
  struct Bar
  {
      
  };
  
  template &lt;class T&gt;
  concept Calcable = ??  // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; How to match generics function calc?
  
  template &lt;Calcable T&gt;
  struct Check
  {
  
  };
  
  int main () {
      auto ret = Foo&lt;int&gt;(3).calc(1,2,3);  // ok
      std::cout&lt;&lt; ret &lt;&lt;std::endl;         // ok
  
      using YES = Check&lt;Foo&lt;int&gt;&gt;;         // I need compile pass
      using NO = Check&lt;Bar&lt;int&gt;&gt;;          // I need compile error
      return 0;
  }
  </code></pre>
  <p>I've been looking for it all day, but <strong>nothing</strong></p>