title: Vector of Tuples in C++
body: <p>I have tried every thing which i could but this code is giving me errors.
  Both syntax are not working. I have commented operator[] but please provide a solution for that as well.</p>
  
  <pre><code>#include &lt;bits/stdc++.h&gt;
  using namespace std;
  int main() {
      typedef vector&lt; tuple&lt;int, int, int&gt; &gt; my_tuple;
      my_tuple tl;
      tl.push_back( tuple&lt;int, int, int&gt;(21,20,19) );
      for (my_tuple::const_iterator i = tl.begin(); i != tl.end(); ++i) {
          //cout &lt;&lt; get&lt;0&gt;(tl[i]);
          //cout &lt;&lt; get&lt;0&gt;(tl[i]);
          //cout &lt;&lt; get&lt;0&gt;(tl[i]);
          cout &lt;&lt; get&lt;0&gt;(tl.at(i));
          cout &lt;&lt; get&lt;1&gt;(tl.at(i));
          cout &lt;&lt; get&lt;2&gt;(tl.at(i));
      }
  
      return 0;
  }
  </code></pre>
  
  <p>while printing tuple in for loop i am getting error.</p>
  
  <pre><code>error: no matching function for call to 'std::vector&lt;std::tuple&lt;int, int, int&gt; &gt;::at(std::vector&lt;std::tuple&lt;int, int, int&gt; &gt;::const_iterator&amp;)'
  </code></pre>
  
  <p>and for operator[ ]</p>
  
  <pre><code>error: no match for 'operator[]' (operand types are 'my_tuple {aka std::vector&lt;std::tuple&lt;int, int, int&gt; &gt;}' and 'std::vector&lt;std::tuple&lt;int, int, int&gt; &gt;::const_iterator {aka __gnu_cxx::__normal_iterator&lt;const std::tuple&lt;int, int, int&gt;*, std::vector&lt;std::tuple&lt;int, int, int&gt; &gt; &gt;}')
  </code></pre>