Closed riiga closed 2 months ago
What is the benefit of using the auto type? Shouldn't a mishap like the one in the example you provided be caught by -Wconversion?
It will most likely be caught by the compiler. The main benefit is that you don't have to care about the type, but there are of course various degrees to which you can use it. The main downside is you can't really tell what the type is at a glance unless you're using an IDE.
This PR is probably a bit overkill in that regard, so I'll close it. I would still recommend using auto in for loops and with iterators. Maybe I can prepare a more limited PR in the future.
This is probably a bit controversial, so feel free to reject this pull request. It's sometimes a matter of personal preference, though there are instances where it serves a purpose, like