Correct usage of hash_map