You are viewing a single comment's thread. Return to all comments →
"auto it" will create copy of element, while "auto &it" will use reference to element stored inside container.
For this case, it would be clearer to use "auto const &it" since we do not need to modify words in the vector.
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
"auto it" will create copy of element, while "auto &it" will use reference to element stored inside container.
For this case, it would be clearer to use "auto const &it" since we do not need to modify words in the vector.