Reduce usage of auto in line with new recommendation
Quick patch that removes a bunch of "auto" usage for your consideration. The auto->CKeyID change is against the merged segwit patches hence the fake rebase.
Remaining uses are:
- ~70 in test/*
- ~10 in bench/*
- 123 range base for loops
- 27 iterator assignements (begin, end, rbegin, rend, cbegin, cend, find, lower_bound, upper_bound)
- 5 uses of std::pair: 2 emplace results, 1 insert result, 1 bech32::Decode result, and 1 dereference map iterator
- 4 uses with boost::get for variant in keystore.cpp
- 4 closures/lambdas
- reverse_iterator.h template return values
I dont think we ever do backwards-facing changes for style guidelines, no reason to start now?
Usual reasons not to retroactively fix style stuff are:
- it makes it hard to follow history (git blame just points to the reindent commit for every line in the file)
- it makes it hard to do backports or requires active PRs to be rebased
- there's not much practical benefit from the change
That's not the case here: they're just changing one line, so the impact on history is minimal; backports and PRs should barely be impacted, and making the type explicit makes it easier to understand the code so there is an immediate practical benefit... A few of those changes seem worthwhile even without the guideline. But your call.
I mean the change itself seems fine, but the project is already inundated with a flood of cleanup fixes, so I'm not sure more is worth it. Feel free to PR upstream if you prefer.