title: How to append the corresponding value from a tuple of values to a tuple of vectors of the same types?
body: <p>I have a structure of arrays class</p>
  
  <pre><code>template &lt;typename... Ts&gt;
  class soa {
      std::tuple&lt;std::vector&lt;Ts&gt;...&gt; vectors;
      void push_back(std::tuple&lt;Ts...&gt; values);
  }
  </code></pre>
  
  <p>I want <code>push_back</code> to push the tuple of values onto each of the corresponding vectors of each type. I was thinking of doing something with <code>index_sequences</code> but I'm not too sure how to properly do the pack expansion.</p>
  
  <p>This is kind of what I was thinking, but the expansion doesn't work. How should I correctly do the expansion?</p>
  
  <pre><code>template &lt;typename... Ts&gt;
  class soa {
      std::tuple&lt;std::vector&lt;Ts&gt;...&gt; vectors;
  
      template &lt;std::size_t... Is&gt;
      void push_back_impl(std::tuple&lt;Ts...&gt; values, std::index_sequence&lt;Is...&gt;) {
          // Some kind of pack expansion here
          // This doesn't work, but is kinda what I want
          //std::get&lt;Is&gt;(vectors).push_back(std::get&lt;Is&gt;(values))...;
      }
  
      void push_back(std::tuple&lt;Ts...&gt; values) {
          push_back_impl(values, std::index_sequence_for&lt;Ts...&gt;{});
      }
  };
  </code></pre>
  
  <p>Please also correct me if I'm using <code>index_sequence</code> incorrectly. The meta programming is messing with my head a bit.</p>