title: get the elements of a std::tuple by passing the type of another std::tuple
body: <p>I have a structure that makes it easier to manage the tuple:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class... Ts&gt;
  struct Store
  {
      using base_type = std::tuple&lt;Ts...&gt;;
  
      base_type store;
  
      Store(Ts... args)
      {
          store = {args...};
      }
  
      template&lt;size_t... Ints&gt;
      decltype(auto) Get()
      {
          if constexpr(sizeof...(Ints) == 1)
              return std::get&lt;Ints...&gt;(store);
          else
              return std::make_tuple(std::get&lt;Ints&gt;(store)...);
      }
  
      template&lt;class... Us&gt;
      decltype(auto) Get()
      {
          if constexpr(sizeof...(Us) == 1)
              return std::get&lt;Us...&gt;(store);
          else
              return std::make_tuple(std::get&lt;Us&gt;(store)...);
      }
  };
  </code></pre>
  <p>I also have structures that allow me to combine template arguments:</p>
  <pre class="lang-cpp prettyprint-override"><code>template &lt;typename... Ts&gt;
  struct store_helper
  { using type = Store&lt;Ts...&gt;; };
  
  template &lt;typename... Ts&gt;
  struct store_helper&lt;Store&lt;Ts...&gt;&gt;
  { using type = Store&lt;Ts...&gt;; };
  
  template&lt;typename ... Ts1, typename... Ts2&gt;
  struct store_helper&lt;Store&lt;Ts1...&gt;, Ts2...&gt;
  : public store_helper&lt;Store&lt;Ts1..., Ts2...&gt;&gt;
  { };
  
  template&lt;typename ... Ts1, typename ... Ts2, typename... Ts3&gt;
  struct store_helper&lt;Store&lt;Ts1...&gt;, Store&lt;Ts2...&gt;, Ts3...&gt;
  : public store_helper&lt;Store&lt;Ts1..., Ts2...&gt;, Ts3...&gt;
  { };
  
  template&lt;typename... Ts&gt;
  using Scheme = typename store_helper&lt;Ts...&gt;::type;
  </code></pre>
  <p>Now I can do this:</p>
  <pre class="lang-cpp prettyprint-override"><code>int main() {
  
      using Vector2D = Scheme&lt;int, int&gt;;
  
      using Position = Scheme&lt;Vector2D&gt;;
      using Direction = Scheme&lt;Vector2D&gt;;
  
      using Player = Scheme&lt;Position, Direction, float&gt;;
  
      Player store(33, 44, 12, 122, 4.0);
  
      auto float_num = store.Get&lt;float&gt;();
  
      std::cout &lt;&lt; float_num &lt;&lt; std::endl;
      
      return 0;
  }
  
  </code></pre>
  <p>But I'd also like to do that:</p>
  <pre class="lang-cpp prettyprint-override"><code>    auto [x, y] = store.Get&lt;Direction&gt;();
  
      std::cout &lt;&lt; x &lt;&lt; std::endl;
      std::cout &lt;&lt; y &lt;&lt; std::endl;
  </code></pre>
  <p>I need to retrieve data by passing the tuple from which it he created. Is there any way to implement this syntax ?</p>