SomeClass a, b, c;
SomeClass foo();
SomeClass a = (b + c); //Where is the object (b + c) allocated?
SomeClass a = foo(); //Where is the returned value of foo() allocated?
My guess is that they are allocated on the heap because I read that temporary objects are destroyed at the end of the expression(;).
It makes sense to me because the move constructor could be implemented by stealing the pointer of the temporary object on the heap.