Given
void foo( int&& x ) {
std::cout << &x;
}
This works but what does this address actually represent? Is a temporary int
created when foo is called and that is what the address represents? If this is true and if I write int y = 5; foo(static_cast<int&&>(y));
, does this cause another temporary to be created or will the compiler intelligently refer to y?