Quick Q:How to modify a tuple in a vector of tuples c++?
Quick A: Capture the tuple by reference.
Recently on SO:
Modifying a tuple in a vector of tuples c++
I have a vector of tuples
vector<tuple<int,int>> vector;and I want to modify one of the tuples it contains.for (std::tuple<int, int> tup : std::vector) { if (get<0>(tup) == k) { /* change get<1>(tup) to a new value * and have that change shown in the vector */ } }I am unsure how to change the value of the tuple and have the change be reflected in the vector. I have tried using
get<1>(tup) = v;but that doesn't change the value of the tuple that is in the vector. How can I do this? Thanks.

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:
While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:
The C