The C++ rvalue lifetime disaster
Arno Schoedl - a year 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
Embedded Software Engineer (m/f/x)
Lauterbach GmbH
·
27 days ago
Höhenkirchen-Siegertsbrunn, Germany
Customer Support Engineer & Project Leader (f/m/d)
cinemo GmbH
·
1 month ago
Karlsruhe, Germany
+2
Hybrid
Field Application Engineer (FAE) (m/w/d)
Lauterbach GmbH
·
27 days ago
Höhenkirchen-Siegertsbrunn, Germany
Software Developer (m/w/d)
Rheinmetall Electronics GmbH
·
1 month ago
Bremen, Germany
Hybrid
Related Videos