<p>In C++0x I would like to write a function like this:</p>

<pre><code>template &lt;typename... Types&gt;
void fun(typename std::tuple&lt;Types...&gt; my_tuple) {
    //Put things into the tuple
}
</code></pre>

<p>I first tried to use a for loop on <code>int i</code> and then do:</p>

<pre><code>get&lt;i&gt;(my_tuple);
</code></pre>

<p>And then store some value in the result. However, <code>get</code> only works on <code>constexpr</code>.</p>

<p>If I could get the variables out of the <code>tuple</code> and pass them to a variadic templated function I could recurse through the arguments very easily, but I have no idea how to get the variables out of the tuple without <code>get</code>. Any ideas on how to do that? Or does anyone have another way of modifying this <code>tuple</code>?</p>

Since the "i" in
```
```
get<i>(tup)
```
```
needs to be a compile-time constant, template instantiation is used to "iterate" (actually recurse) through the values.  Boost tuples have the "length" and "element" meta-functions that can be helpful here -- I assume C++0x has these too.