#include <iostream>
class X
{
public:
X makeAnX();
};
X X::makeAnX()
{
X aNewX;
return aNewX;
}
int main()
{
X firstX;
std::cout << "Address of first X: " << &firstX << '\n';
auto another = firstX.makeAnX();
std::cout << "Address of another X: " << &another << '\n';
}