Ensure const-correctness in hashmap