Side remark: there's an `unordered_map` in C++ compilers that support the C++11 standard (all the major ones by now). In my experience, that has faster element lookup and assignment. Iteration can be much slower, though, since the typical implementation is a hash table that reserves a lot of space.

Also, typo: "assignment".