The C++ rvalue lifetime disaster
Arno Schoedl - 2 years ago
Rvalue references have been with us since C++11. They have originally been introduced to make moving objects more efficient: the object an rvalue reference references is assumed to go out of scope soon and thus may have its resources scavenged without harm. The C++ standard library, for example std::cref or std::ranges, makes use of yet another aspect of rvalue references: since they go out of scope soon, it is assumed unsafe to hold on to them beyond the scope of the current function, while lvalue references are considered safe. We, too, found this assumption to be very useful for smart memory management, in particular in generic code...
Jobs with related skills

Software Engineer (f/m/x)
Raiffeisen Bank International AG
·
10 days ago
Vienna, Austria
Hybrid

Team Lead Software Development
OD-OS GmbH
·
24 days ago
Teltow, Germany

Senior Agentic Data Scientist, Applied Mathematics & AI
Dynatrace
·
1 month ago
Vienna, Austria
+1
Hybrid
Newest jobs

Architekt für Cloud Security - AWS (w|m|d)
zeb consulting
·
today
Frankfurt am Main, Germany
+4
Hybrid
Related Videos