I have a tuple vector<tuple<int,int>> vector; , and I want to change one of its tuples.
for (std::tuple<int, int> tup : std::vector) { if (get<0>(tup) == k) { } }
I am not sure how to change the value of the tuple and be reflected in the vector. I tried using
get<1>(tup) = v;
but this does not change the meaning of the tuple in the vector. How can i do this? Thanks.
source share