In article "Move semantics and rvalue references in C++11" by Alex Allain, I read:
Notice, by the way, that holding on to a
const
reference to a temporary object ensures that the temporary object isn't immediately destructed. This is a nice guarantee ofC++
, but it is still a temporary object, so you don't want to modify it.
Of course I know that a const reference is not, nor behaves like, a shared_ptr
(which one would hope, reading "holding on [...]
the temporary object isn't immediately destructed"), but I wasn't able to find any more reference.
So the question is: How is this addressed in the standard?