Only const reference can bound to temporary and prolong temporary
variable life. temporary is not lvalue, and only lvalue can bound to reference
to non-const. And only stack-base const reference can work in this way. If a
const reference is class member, it can’t work. See two examples below:
const reference bound to rvalue used in copy ctor widely. See example below:
But in C++11, For a class with a lot allocated resource, please use move
copy ctor which explained in the next section: