3 ms·
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 i
by FpUser 2y ago
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.
- deleted 2y ago[deleted]
- secondcoming 2y agoExcept this makes a copy of each member in set_of_members, which is probably not what you want. https://godbolt.org/z/1YnEs1M34 https://godbolt.org/z/1YnEs1M34
- FpUser 2y agoThis 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.