If I have a program:
#include using namespace std; int TestIntReturn(int &x, int &y) { x = 1000; y = 1000; return x+y;
In the case of primitive types, nothing happens to it. It is just ignored. In the case of class types, the returned object will be destructed, without anything else happening to it.