In C++ you cannot initialize a reference from an rvalue because the rvalue is immediately destroyed. How can const references be initialized from rvalues?
For example:
int f() {
return 3;
}
int main() {
const int& x = f(); // ok
int& y = f(); // error: invalid initialization of non-const reference of
// type ‘int&’ from an rvalue of type ‘int’
}