Grabbing the return value before it's erased.
I made a class:
//the problem is, that the return value of a_function gets destroyed BEFORE the assignment is done, thus the "cout ... " will print unexpected results.
}; //there is no special usage for this class. I just want to show my problem
temp.a = 4;
Test b = a_function();
cout << b.a << endl;
How can I make a copy of the return value before it's destroyed.