title: How to passing function overload set as template parameter
body: <p>I have code like this:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;auto Function&gt;
  struct Bind
  {
      template&lt;typename... Args&gt;
      static auto func(Args&amp;&amp;... args)
      {
          return std::invoke(Function, args...);
      }
  };
  
  struct F
  {
      int i;
      auto foo(int ii){ i = ii; }
  };
  
  int main()
  {
      F f{};
      Bind&lt;&amp;F::foo&gt;::func(f, 5); //set `i` to 5
      return Bind&lt;&amp;F::i&gt;::func(f); //return 5
  }
  </code></pre>
  
  <p>But now I need add new function <code>int F::foo();</code> and I still need be able to call both from <code>func</code>, like:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;typename TBind&gt;
  auto bar(F f)
  {
      TBind::func(f, 5); // calls `void F::foo(int)`
      return TBind::func(f); // calls `int F::foo()`
  }
  </code></pre>
  
  <p>Is possible to do it in C++17 and still use <code>auto Function</code>?</p>
  
  <p>(C++20 can have custom types as value template argument that solve this problem)</p>