Arno Schoedl
The C++ rvalue lifetime disaster
#1about 3 minutes
The dual role of rvalue references in C++
Rvalue references were introduced for move semantics to avoid copies but are also used to manage the lifetime of temporary objects.
#2about 6 minutes
Why temporary lifetime extension fails in modern C++
The pre-C++11 feature for extending temporary object lifetimes does not work correctly with rvalue references, necessitating a custom macro to create a value or reference based on expression type.
#3about 6 minutes
How accessor methods cause rvalue amnesia
Standard accessor methods returning a const lvalue reference incorrectly bind to rvalues, losing critical lifetime information and leading to dangling references.
#4about 4 minutes
A proposal for fixing C++ reference binding rules
A proposed language fix using pragmas would introduce new, safer reference binding rules to prevent short-lived rvalues from binding to long-lived lvalue references.
#5about 3 minutes
Practical mitigations for rvalue lifetime issues today
Use custom macros to manage variable lifetimes, guard member accessors, and implement a correct ternary operator to work around the language's flawed binding rules.
#6about 1 minute
Managing C++ complexity with strong coding guidelines
The best way to manage the growing complexity of C++ is to establish strong internal coding guidelines and use custom libraries to standardize code patterns.
Related jobs
Jobs that call for the skills explored in this talk.
ROSEN Technology and Research Center GmbH
Osnabrück, Germany
Senior
TypeScript
React
+3
MARKT-PILOT GmbH
Stuttgart, Germany
Remote
€75-90K
Senior
Java
TypeScript
+1
Matching moments
02:49 MIN
Using AI to overcome challenges in systems programming
AI in the Open and in Browsers - Tarek Ziadé
03:31 MIN
The value of progressive enhancement and semantic HTML
WeAreDevelopers LIVE – You Don’t Need JavaScript, Modern CSS and More
01:06 MIN
Malware campaigns, cloud latency, and government IT theft
Fake or News: Self-Driving Cars on Subscription, Crypto Attacks Rising and Working While You Sleep - Théodore Lefèvre
06:47 MIN
Solving date and time issues with the Temporal API
WeAreDevelopers LIVE – You Don’t Need JavaScript, Modern CSS and More
01:15 MIN
Crypto crime, EU regulation, and working while you sleep
Fake or News: Self-Driving Cars on Subscription, Crypto Attacks Rising and Working While You Sleep - Théodore Lefèvre
07:39 MIN
Prompt injection as an unsolved AI security problem
AI in the Open and in Browsers - Tarek Ziadé
11:32 MIN
The industry's focus on frameworks over web fundamentals
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
02:44 MIN
Rapid-fire thoughts on the future of work
What 2025 Taught Us: A Year-End Special with Hung Lee
Featured Partners
Related Videos
An (In-)Complete Guide to C++ Object Lifetimes
Jonathan Müller
C++ in constrained environments
Bjarne Stroustrup
C++ Features You Might Not Know
Jonathan Müller
101 brilliant things of C++
Andreas Fertig
The Design and Evolution of C++
Bjarne Stroustrup
Why Iterators Got It All Wrong — and what we should use instead
Arno Schödl
Guided Memory Management: Rust's Ownership Model
Stefan Baumgartner
A Love Letter to Rust
Rainer Stropek
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.



Rithum
Remote
Intermediate
API
GIT
Azure
NoSQL
+19



Canonical Ltd.
Remote
Intermediate
C++
Linux
OpenGL
Flutter


VITRONIC Dr.-Ing. Stein Bildverarbeitungssysteme GmbH
Bruchsal, Germany
Senior
Go
C++
GIT
Linux
React
+6

ROHDE & SCHWARZ GmbH & Co. KG
München, Germany
Junior
C++
GIT
Linux
Docker
Continuous Integration