title: Using std::apply with variadic packs
body: <p>I am trying to create a generic class that takes a pack of types, stores them in a tuple, and can apply a function over them. </p>
  
  <p>What I tried so far is the following:</p>
  
  <pre><code>#include &lt;tuple&gt;
  struct Base{
      virtual void base_function() = 0;
  };
  
  template&lt;typename ...T&gt;
  struct A : public Base{
      std::tuple&lt;T...&gt; as;
      A(T... pack):as(pack...){};
      void base_function(){
          std::apply([](auto t){t.base_function();}, as);
      }
  };
  
  struct B : public Base{
      void base_function(){};
  };
  
  
  struct C : public Base{
      void base_function(){};
  };
  
  struct D : A&lt;B, C&gt;{
      D():A(B(),C()){};
  };
  </code></pre>
  
  <p>I expected apply to be called on base_function from class B and C when calling base_function on D. But the compiler generates the following error:</p>
  
  <blockquote>
    <p>error: no matching function for call to<br>
    '<code>__invoke(A&lt;T&gt;::base_function() [with T = {B, C}]::&lt;lambda(auto:1)&gt;,
    std::__tuple_element_t&lt;0, std::tuple&lt;B, C&gt; &gt;&amp;,
    std::__tuple_element_t&lt;1, std::tuple&lt;B, C&gt; &gt;&amp;)</code>'</p>
  </blockquote>