// for std::move
#include <utility>
#include <iostream>
using namespace std;
int main()
{
int x = 5; // x: lvalue
int* p = &x;
int& y = x; // y: lvalue?
const int& z = x; // z: lvalue?
int&& y1 = std::move(x); // y1: xvalue
int&& y2 = std::move(y1); // y2: xvalue
int x1 = std::move(x); // different address from x
//int& x2 = std::move(x); // invalid because non-const
const int& x2 = std::move(x); // same address as x
cout << "y1= " << y1 << endl;
cout << "y2= " << y2 << endl;
cout << "&y1= " << &y1 << endl;
cout << "&y2= " << &y2 << endl;
cout << endl << "x1= " << x1 << endl;
cout << "&x1= " << &x1 << endl;
cout << endl << "x2= " << x2 << endl;
cout << "&x2= " << &x2 << endl;
return 0;
}