|
|
|
|
|
by superrad
3777 days ago
|
|
std::unordered_map<std::string, SomeClassName>::iterator it = hashmap.begin(); vs auto it = hashmap.begin(); I find auto useful for cutting down some of the verbosity of templates STL containers, but I can see how over use can lead to code requiring much more referencing if maintaining code that rarely defines types. |
|
No doubt auto is extremely useful in a case like the one you mentioned. In fact, even more so in here:
for (std::unordered_map<std::string, std::unordered_map<std::string, long>*>::const_iterator it = a.begin(); ...)