The unordered containers in C++ are implemented as hash tables with separate chaining. The standard does not specify this implementation explicitly. But, by examining the requirements of the container, this is and will be the implementation in any C++ standard library.
Given this implementation, it would be an instructive exercise to be able to print out the actual structure of the hash table, with its buckets and linked list of keys. Thankfully, this is possible since the standard provides a
bucket_count method and a
begin method that takes a bucket index as input.
Here is simple code that prints buckets of
unordered_set and its output on my computer:
Tried with: GCC 5.1 and Ubuntu 14.04