June 2017
Intermediate to advanced
532 pages
12h 59m
English
Usually, when we instantiate a hash-based map implementation like std::unordered_map, we write:
std::unordered_map<key_type, value_type> my_unordered_map;
It is not too obvious that there happens a lot of magic in the background when the compiler creates our std::unordered_map specialization. So, let's have a look at the complete template-type definition of it:
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;
The first two template types are those we filled with coord and int, which is the simple and obvious part. The other three template types are optional, as they are automatically filled ...
Read now
Unlock full access