Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am in a middle ground. Usually do not use auto but in the cases like:

   for (auto member : set_of_members)
and some other that are similar by nature auto is a god blessing.


Except this makes a copy of each member in set_of_members, which is probably not what you want.

https://godbolt.org/z/1YnEs1M34


This was to illustrate a point of auto rather than intricacies of copying, referencing. I know what I want and am familiar with auto&, const auto&, auto&& etc. etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: