I think the question is clear enough. Will the auto
keyword auto-detect const-ness, or always return a non-const type, even if there are eg. two versions of a function (one that returns const
and the other that doesn't).
Just for the record, I do use const auto end = some_container.end()
before my for-loops, but I don't know if this is necessary or even different from normal auto
.