3 ms·
More likely, someone who hasn't programmed C++ in the last 10 years. Forgetting auto, and using the cumbersome 3-part for loop with iterator boilerplate when yo
by unscaled 11y ago
More likely, someone who hasn't programmed C++ in the last 10 years. Forgetting auto, and using the cumbersome 3-part for loop with iterator boilerplate when you only need value shows age. Initializing the list is also easier now, with initializer lists syntax, so you could just do:
list<string> lst = { "tomato", "grape", "apple", "orange"};
and cut another 4 lines, making the C++ line count half of C version. Not a negligible difference, as the author claims.