2 Replies
The first one copies the user object, creating new memory. The second one modifies the object, without any new allocations. From a performance standpoint, the second one is better. But the first one is more intuitive
what would you use?
or do you have a better suggestion?