Q:

How does this C++ unordered_map have four values? I thought it was a key value pair

I came across the following code: unordered_map<id, id, hashid, eqid> map
All the unordered maps I've seen only have two "params", the key and value types, what do the other two do?

A:

Read the docs. The template takes up to five parameters, but the last three are defaulted:
template<
    class Key,
    class T,
    class Hash = std::hash<Key>,
    class KeyEqual = std::equal_to<Key>,
    class Allocator = std::allocator< std::pair<const Key, T> >
> class unordered_map;

It still stores key and value, but it's using a custom hash and equality testing function.

