unordered_map
#include <unordered_map>
class KVCache {
public:
void put(const string& key, const string& value) { cache[key] = value; }
string get(const string& key) { return cache[key]; }
private:
unordered_map<string, string> cache;
};#include <unordered_map>
unordered_map<string, int> word_counts;
for (const string& word : words) {
word_counts[word]++;
}#include <unordered_map>
unordered_map<string, vector<string>> items_by_category;
for (const string& item : items) {
items_by_category[category(item)].push_back(item);
}