Back to Basics: RAII and the Rule of Zero - Arthur O'Dwyer - CppCon 2019
http://CppCon.org
—
Discussion & Comments: https://www.reddit.com/r/cpp/
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2019
—
RAII, or "Resource Allocation is Initialization," is one of the cornerstones of C++. What is it, why is it important, and how do we use it in our own code?
Small resource-managing classes should follow the Rule of Three (or Five); larger, composite, business-logic classes should follow the Rule of Zero. We'll explain these "Rules," what they mean, and how their consistent application helps us avoid resource leaks and double-frees. We'll also show how thinking about the Rule of Three can lead to a consistent guideline for polymorphic classes with virtual destructors.
Finally, we'll touch on the "copy and swap" idiom, which in many cases can reduce the Rule of Five to the Rule of Four (and a Half).
Attendees will leave this session with a clearer understanding of resource management in C++.
—
Arthur O'Dwyer
New York
Arthur O'Dwyer is the author of "Colossal Cave: The Board Game," "Mastering the C++17 STL" (the book), and "The STL From Scratch" (the training course). He runs professional C++ training courses, is occasionally active on the C++ Standards Committee, and has a blog mostly about C++.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
Видео Back to Basics: RAII and the Rule of Zero - Arthur O'Dwyer - CppCon 2019 канала CppCon
—
Discussion & Comments: https://www.reddit.com/r/cpp/
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2019
—
RAII, or "Resource Allocation is Initialization," is one of the cornerstones of C++. What is it, why is it important, and how do we use it in our own code?
Small resource-managing classes should follow the Rule of Three (or Five); larger, composite, business-logic classes should follow the Rule of Zero. We'll explain these "Rules," what they mean, and how their consistent application helps us avoid resource leaks and double-frees. We'll also show how thinking about the Rule of Three can lead to a consistent guideline for polymorphic classes with virtual destructors.
Finally, we'll touch on the "copy and swap" idiom, which in many cases can reduce the Rule of Five to the Rule of Four (and a Half).
Attendees will leave this session with a clearer understanding of resource management in C++.
—
Arthur O'Dwyer
New York
Arthur O'Dwyer is the author of "Colossal Cave: The Board Game," "Mastering the C++17 STL" (the book), and "The STL From Scratch" (the training course). He runs professional C++ training courses, is occasionally active on the C++ Standards Committee, and has a blog mostly about C++.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
Видео Back to Basics: RAII and the Rule of Zero - Arthur O'Dwyer - CppCon 2019 канала CppCon
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
CppCon 2019: Arthur O'Dwyer “Back to Basics: Smart Pointers”CppCon 2017: Nir Friedman “What C++ developers should know about globals (and the linker)”CppCon 2018: Stoyan Nikolov “OOP Is Dead, Long Live Data-oriented Design”CppCon 2018: Bjarne Stroustrup “Concepts: The Future of Generic Programming (the future is here)”CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”CppCon 2017: Carl Cook “When a Microsecond Is an Eternity: High Performance Trading Systems in C++”CppCon 2019: Andrei Alexandrescu “Speed Is Found In The Minds of People"Back to Basics: Concurrency - Arthur O'Dwyer - CppCon 2020CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”CppCon 2015: Andrei Alexandrescu “std::allocator...”CppCon 2019: Jason Turner “The Best Parts of C++"CppCon 2017: Kate Gregory “10 Core Guidelines You Need to Start Using Now”What is C++ - Chandler Carruth, Titus Winters - CppCon 2019CppCon 2016: Michael Caisse “Asynchronous IO with Boost.Asio"Back to Basics: Lambdas from Scratch - Arthur O'Dwyer - CppCon 2019Breaking Dependencies: The SOLID Principles - Klaus Iglberger - CppCon 2020Writing Safety Critical Automotive Software for High Perf AI Hardware - Michael Wong - CppCon 2019Back to Basics: Function and Class Templates - Dan Saks - CppCon 2019CppCon 2018: Arthur O'Dwyer “Return Value Optimization: Harder Than It Looks”