When you wrote:
//------------------vv---->10 is a prvalue and temporary materialization will result in an xvalue
const int& number = 10;
temporary materialization happens as can be seen from temporary materilization:
Temporary materialization occurs in the following situations:
- when binding a reference to a prvalue;
Now number
refers to the materialized temporary(xvalue).
Moreover the lifetime of the temporary is extended as can be seen from lifetime
The lifetime of a temporary object may be extended by binding to a const lvalue reference or to an rvalue reference (since C++11), see reference initialization for details.