Discussion: Whether to use auto
for iterators
#800
Replies: 1 comment 1 reply
-
In general, I highly prefer being specific with types - even return types - and really don't like
can be quite bother some to type out regularly. So using For example, looping over an iterable should generally be done in a relatively short block so the type should be generally evident especially since you're iterating over it so
However, if you're randomly accessing the iterator where it's going to get handed around or manipulated outside of a loop then
Make sense? |
Beta Was this translation helpful? Give feedback.
-
let someString = String('blah blah')
However, I'm less comfortable with replacing std::list::iterator with auto. I prefer to clearly see my C++ abominations.
Originally posted by @royfalk in #789 (comment)
Beta Was this translation helpful? Give feedback.
All reactions