title: C++20 : Parameter pack partial expansion
body: <p>I need a way to partially expand a parameter pack. The size of the subset has to be determined by another variadic parameter. It will be more clear what I mean with sample code.</p>
  <pre class="lang-cpp prettyprint-override"><code>
  struct EntityA {
      EntityA(int, char, unsigned) {}
      EntityA(int, char, unsigned*) {}
      EntityA(int, char*, unsigned*) {}
      EntityA(int*, char*, unsigned*) {}
  }
  // various types of entities
  // ...
  
  // Service provides Args. 
  template &lt;typename ... Args&gt;
  struct Service {
      // returns provided Args
      template &lt;typename T&gt;
      T get() { return T{}; }
  };
  
  // this function should call appropriate overload of E by looking at sizeof...(pArgs)
  template &lt;typename E, typename ... SArgs&gt;
  E
  construct(Service&lt;SArgs ...&gt;&amp; service, auto&amp;&amp; ... pArgs) {
      // somehow i need to expand and get first half from service and get others from parameters
      return E{service.get&lt;SArgs&gt; ..., std::forward&lt;decltype(pArgs)&gt;(pArgs) ...};
  }
  
  
  int main() {
      Service&lt;int, char, unsigned&gt; service;
      construct&lt;EntityA&gt;(service);
      construct&lt;EntityA&gt;(service, (unsigned*)nullptr);
      construct&lt;EntityA&gt;(service, (char*)nullptr, (unsigned*)nullptr);
      construct&lt;EntityA&gt;(service, (int*)nullptr, (char*)nullptr, (unsigned*)nullptr);
  
      return 0;
  }
  
  </code></pre>
  <p>Some objects(template parameter E) need to be constructed with parameters partially from service and partially from client code. Is there a way to implement this?</p>