3 ms·
What do you mean? Here, "auto" is being used to define a variable, just like the way "let" does in other languages. for (let i = results.begin( ); i != re
by klodolph 11y ago
What do you mean? Here, "auto" is being used to define a variable, just like the way "let" does in other languages.
for (let i = results.begin( ); i != results.end( ); ++i)
This matches the use of "let" in Haskell, Lisp, Rust, ES6, etc.
(Note that when I say "variable" in this context, I am using it as the hypernym, not in the sense where it denotes only mutable variables.)
- Ono-Sendai 11y agoWhat I mean is that for me, 'auto' in C++ means something like 'automatic type', e.g. it stands in for the actual type, whereas let x = some_expr means something else - it doesn't really say anything directly about the type of x.