Do rvalue references allow dangling references?
Consider the below. #include <string> using std::string; string middle_name () { return "Jaan"; } int main () { string&& danger = middle_name(); // ?! return 0; } This doesn't compute anything, but it compiles without error and demonstrates something that I find confusing: danger is a dangling reference, isn't it? Do rvalue references allow dangling references? If you meant "Is it possible to create dangling rvalue references" then the answer is yes. Your example, however, string middle_name () { return "Jaan"; } int main() { string&& nodanger = middle_name(); // OK. // The life-time of the