would you write this
auto x = *it;
// modify it
if(error)
*it = x;

instead of this?
auto x = *it;
// modify x
if(ok)
*it = x;

like you think you are making a backup or something? who would do that? cmon...

in general would you make a copy and hold on to it unless you want to modify it? why?

ok in your closet maybe, but not in generic code cmon, not in a libraryyyyy ToT

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.