Understanding the Rule Of 3 in C++

preview_player
Показать описание
If you use C++ and work with dynamically allocated memory or objects that are copied or assigned to each other, you need to be familiar with the Rule of 3. In this video, we'll explore what the Rule of 3 is, why it's important, and how to apply it in your C++ code.
Рекомендации по теме
Комментарии
Автор

thank you so much, you have no idea how much this video has helped me

ibrahimshariff
Автор

One thing to note here, the compiler sees obj3 = obj1 differently than RuleOfThree obj3 = obj1. for obj3 = obj1, compiler sees it as mere assignment operation and it executes the default copy constructor, but if compiler sees RuleOfThree obj3 = obj1, it will execute the user-defined copy constructor.

chiyang
Автор

this one of the better informative videos ive ever seen

Aaron_Bernstein
Автор

I enjoyed your style of explanation - any chance you’ll do a video on rule of 5 and move semantics as well?

BradCooley
Автор

Great explanation, came in not knowing and left knowing

cuppajoeman
Автор

Great tutorial! Thanks for putting it out!

timothymusson