#include <unordered_map>
#include <iostream>
int main() {
using Vote = std::pair<std::string, std::string>;
auto hash = [](const Vote& v){
return std::hash<std::string>()(v.first) * 31 + std::hash<std::string>()(v.second);
};
using Unordered_map = std::unordered_map<Vote, int, decltype(hash)>;
Unordered_map um(8, hash);
um.insert({ { "John", "Miller" }, 1 });
um.insert({ { "Jill", "Samson" }, 2 });
um.insert({ { "Jane", "Decker" }, 3 });
for (auto const &v : um)
std::cout << v.first.first.c_str() << " " << v.first.second.c_str() << ", " << v.second << std::endl;
return 0;
}
I2luY2x1ZGUgPHVub3JkZXJlZF9tYXA+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCmludCBtYWluKCkgewogICAgdXNpbmcgVm90ZSA9IHN0ZDo6cGFpcjxzdGQ6OnN0cmluZywgc3RkOjpzdHJpbmc+OwogICAgYXV0byBoYXNoID0gW10oY29uc3QgVm90ZSYgdil7CiAgICAgICAgcmV0dXJuIHN0ZDo6aGFzaDxzdGQ6OnN0cmluZz4oKSh2LmZpcnN0KSAqIDMxICsgc3RkOjpoYXNoPHN0ZDo6c3RyaW5nPigpKHYuc2Vjb25kKTsKICAgIH07CiAgICB1c2luZyBVbm9yZGVyZWRfbWFwID0gc3RkOjp1bm9yZGVyZWRfbWFwPFZvdGUsIGludCwgZGVjbHR5cGUoaGFzaCk+OwogICAgVW5vcmRlcmVkX21hcCB1bSg4LCBoYXNoKTsKCiAgICB1bS5pbnNlcnQoeyB7ICJKb2huIiwgIk1pbGxlciIgfSwgMSB9KTsKICAgIHVtLmluc2VydCh7IHsgIkppbGwiLCAiU2Ftc29uIiB9LCAyIH0pOwogICAgdW0uaW5zZXJ0KHsgeyAiSmFuZSIsICJEZWNrZXIiIH0sIDMgfSk7CgogICAgZm9yIChhdXRvIGNvbnN0ICZ2IDogdW0pCiAgICAgICAgc3RkOjpjb3V0IDw8IHYuZmlyc3QuZmlyc3QuY19zdHIoKSA8PCAiICIgPDwgdi5maXJzdC5zZWNvbmQuY19zdHIoKSA8PCAiLCAiIDw8IHYuc2Vjb25kIDw8IHN0ZDo6ZW5kbDsKCglyZXR1cm4gMDsKfQ==