title: How can you iterate over the elements of an std::tuple?
body: <p>How can I iterate over a tuple (using C++11)? I tried the following:</p>
  
  <pre><code>for(int i=0; i&lt;std::tuple_size&lt;T...&gt;::value; ++i) 
    std::get&lt;i&gt;(my_tuple).do_sth();
  </code></pre>
  
  <p>but this doesn't work:</p>
  
  <blockquote>
    <p>Error 1: sorry, unimplemented: cannot expand ‘Listener ...’ into a fixed-length argument list.<br>
    Error 2: i cannot appear in a constant expression.</p>
  </blockquote>
  
  <p>So, how do I correctly iterate over the elements of a tuple?</p>