Safely copying, moving, and destroying objects in Modern C++ with the rule of "all or nothing"
Help me keep doing these videos! This works relies on your support! You can show it in one of these ways: š Start a FREE Audible trial: https://www.audibletrial.com/CodeForY... šļø Buy gear I use to make this video: https://github.com/cpp-for-yourself/s... š¶ Directly become a sponsor on GitHub: https://github.com/sponsors/niosus šŗ Watch my videos to the end and leave comments āļø Find your way to support this work here: https://github.com/cpp-for-yourself/s... Which constructors does a C++ class need? Which does it generates on its own? What about various assignment operators? And a destructor? How not to shoot ones leg off and navigate these waters effortlessly? This and more we cover in this video that tells us a simple rule to follow when implementing classes in Modern C++, the rule of "all or nothing". We dive into the reasons for its existence and see how it makes our lives easier. š As always, the script to the video lives here: https://github.com/cpp-for-yourself/s... Related videos and materials: Move semantics video: Ā Ā Ā ā¢Ā Re-inventingĀ moveĀ semanticsĀ inĀ modernĀ C++Ā ...Ā Ā Object lifecycle video: Ā Ā Ā ā¢Ā C++Ā objectĀ lifecycleĀ 101:Ā theĀ essentialsĀ Ā Raw pointers video: Ā Ā Ā ā¢Ā MasteringĀ C++Ā pointers:Ā theĀ prosĀ andĀ consĀ ...Ā Ā Google style on naming: https://google.github.io/styleguide/c... Rule of 5/3/0 on cppreference.com: https://en.cppreference.com/w/cpp/lan... Rule of all or nothing from Arne Mertz blog: https://arne-mertz.de/2015/02/the-rul... CPP Core Guidelines on the rule of 5, rule of 0: http://isocpp.github.io/CppCoreGuidel... The frustrated person video clip is from pexels.com

Headers and libraries, but with classes

Re-inventing move semantics in modern C++ in 13 minutes

Why use forwarding references and how they are different from rvalue references in C++

Back to Basics: The Rule of Five in C++ - Andre Kostur - CppCon 2023

Copying and Copy Constructors in C++

Back to Basics: RAII and the Rule of Zero - Arthur O'Dwyer - CppCon 2019

(almost) All the ways to handle errors in C++

INHERITANCE in C++ | most of the things you need to know for OOP and beyond š

Const correctness in C++

Casey Muratori ā The Big OOPs: Anatomy of a Thirty-five-year Mistake ā BSC 2025

Stop using std::vector wrong

Classes part 10 - Rule of Five - Have fun reducing memory allocations! | Modern Cpp Series Ep. 46

Never free memory yourself! Do this instead (in modern C++)
![C++ Tutorial: Rule of 5 [move constructor, move assignment operator]](https://i.ytimg.com/vi/E4MWxaUy3zo/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLASZZdU9WHbwcvP_LA9zGXfydCCgg)
C++ Tutorial: Rule of 5 [move constructor, move assignment operator]

Why use templates in modern C++

Modern C++: Unique Ptrs and Vectors

"Clean" Code, Horrible Performance

C++ Weekly - Ep 421 - You're Using optional, variant, pair, tuple, any, and expected Wrong!

Return Value Optimization and Copy Elision in C++

