title: Modifying a tuple in a vector of tuples c++
body: <p>I have a vector of tuples <code>vector&lt;tuple&lt;int,int&gt;&gt; vector;</code> and I want to modify one of the tuples it contains. </p>
  
  <pre><code>for (std::tuple&lt;int, int&gt; tup : std::vector)
  {
      if (get&lt;0&gt;(tup) == k)
      {
          /* change get&lt;1&gt;(tup) to a new value
           * and have that change shown in the vector
           */
      }
  }
  </code></pre>
  
  <p>I am unsure how to change the value of the tuple and have the change be reflected in the vector. I have tried using </p>
  
  <pre><code>get&lt;1&gt;(tup) = v;
  </code></pre>
  
  <p>but that doesn't change the value of the tuple that is in the vector. How can I do this? Thanks.</p>