std::get returns a reference to the value. Therefore, you set the value as follows:
std::get<0>(myTuple) = newValue;
This, of course, assumes that myTuple not const. You can even move elements from the tuple via std::move by calling it in the tuple:
auto movedTo = std::get<0>(std::move(myTuple));
Nicol Bolas Sep 17 '11 at 8:50 2011-09-17 08:50
source share