YoVDO

The C++ Rvalue Lifetime Disaster - Understanding and Mitigating Issues

Offered By: cpponsea via YouTube

Tags

C++ Courses Memory Management Courses Generic Programming Courses Memory Corruption Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the intricacies of C++ rvalue lifetimes in this conference talk from C++ on Sea 2023. Delve into the challenges and potential pitfalls of rvalue references, including their impact on memory management and code safety. Learn about the unexpected behavior of rvalues binding to const& and the limitations of temporary lifetime extension. Discover a library-only approach to mitigate these issues and consider a proposal for potential language improvements. Gain insights from real-world examples of memory corruption caused by these problems and understand their implications for generic code and the C++ standard library.

Syllabus

Introduction
Rvalue Lifetime
Named Return Value Optimization
No Named Return Value Optimization
A Special Case
Recommendations
Temporary Lifetime Extension
Generic Code
Lifetime Extension
Example
The problem
The solution
Declaration type
Autocrf
Autocrf const
Autocrf rvalue
Accessors
C
What C does
We made a mess
Warning
Requirements
Reference Binding
Trying it out
Impact on the standard library
Mitigations
Member Accessors
Conclusion


Taught by

cpponsea

Related Courses

Heterogeneous Parallel Programming
University of Illinois at Urbana-Champaign via Coursera
Advanced Operating Systems
Georgia Institute of Technology via Udacity
計算機程式設計 (Computer Programming)
National Taiwan University via Coursera
Introduction to Operating Systems
Georgia Institute of Technology via Udacity
Android Performance
Google via Udacity