Zig's HashMap - Part 3

Karl Seguin continues on zig HashMap

Zig’s HashMap - Part 3
The Context is a simple interface which makes HashMap usable for any key. As long as you can provide a hash and eql implementation, you can use any type of key.

Zig’s HashMap - Part 2
Loosely speaking, Zig’s hash map are implemented using two slices: one for keys and one for values.

Zig’s HashMap - Part 1
Like most hash map implementations, Zig’s std.HashMap relies on 2 functions,
hash(key: K) u64 and eql(key_a: K, key_b: K) bool

3 Likes