Reputation: 614
I have an unordered map with string keys and a tuple of three strings and one int. How can I access the individual tuples to set them.
Given:
std::unordered_map<string,std::tuple<string, string, string,int>> foo_data_by_username;
How can I set the individual tuple values of say foo_data_by_username[some_user];
Upvotes: 1
Views: 1026
Reputation: 4359
std::get<0>(foo_data_by_username[some_user]) = "new string";
Where 0
is whichever index of the tuple you're interested in.
Upvotes: 6