I am came across a question Which is better i++ or ++i.
Somebody said ++i as it does not require copy c-or . I just want to know what is a copy c-or and is it a disadvantage to use such a thing ?
I am came across a question Which is better i++ or ++i . Somebody
Share
Both “copy c-or” and “copy ctor” refer to the “copy constructor”, which essentially refers to the object having to be copied.
The reason for this is that the post-increment operator increments the object in question, but also returns the original object in the expression, necessitating a copy.