std::map has an insert method that takes a \"hint\" iterator that will reduce the insertion time from log(n) to constant time if the hint is correc
std::map
insert
The hint allows the unordered map implementation to do a value compare first to see if the hint works. This avoids having to do the hash function which can be more costly than a compare operation.