Instead use a vector of struct, this expands to less code, and the overhead of a hash table isn't needed here.