#include <iostream>
using namespace std;

void test1()
{
	int x = 5;
	int& y = x;
	y = 7;
	cout << "x (" << &x << ") = " << x << ", ";
	cout << "y (" << &y << ") = " << y << endl;
}

void test2() {
	// doesn't compile!
	/*
	int&& x = 5;
	int&& y = x;
	cout << "x (" << &x << ") = " << x << ", ";
	cout << "y (" << &y << ") = " << y << endl;
	*/
}

void test3()
{
	int&& x = 5;
	int&& y = 8;
	y = x;
	cout << "x (" << &x << ") = " << x << ", ";
	cout << "y (" << &y << ") = " << y << endl;
}

void test4()
{
	int&& x = 5;
	int&& y = std::move(x);
	y = 7;
	cout << "x (" << &x << ") = " << x << ", ";
	cout << "y (" << &y << ") = " << y << endl;
}

int main()
{
	test1();
	test2();
	test3();
	test4();
	return 0;
}