unordered_map<T, pair<int, T>> _sets;
Let's say I have a key called _key, how can I access the data in the unordered_map? How can I get the data type T and int from the pair<>?
unordered_map<T, pair<int, T>> _sets;
Let's say I have a key called _key, how can I access the data in the unordered_map? How can I get the data type T and int from the pair<>?
T myT = _sets[_key].first;
pair<int, T> myPair = _sets[_key].second;
int fromPairInt = myPair.first;
T fromPairT = myPair.second;
fast access:
int fromPairInt = (_sets[_key].second).first;
T fromPairT = (_sets[_key].second).second;