C++ object lifecycle 101: the essentials

preview_player
Показать описание
We regularly create instances of objects in C++. These objects get created and destroyed. Today we learn the basics behind how it all happens through the machinery of constructors and destructors. We will cover when which constructor is called, what are member initializer lists, when to use explicit keyword and what

Hope you enjoy this one! Please leave any suggestions below the video or tell what you liked about the video!

The thumbnail is generated using Midjourney and is available under Creative Commons Noncommercial 4.0 license from them.
Рекомендации по теме
Комментарии
Автор

Thanks for watching as always! Please leave a comment with any suggestions or ideas or feedback that you might have! 🙏

CodeForYourself
Автор

Nice video. Very good explanation without unnecessary details.
One thing I would mention (without going into too much detail) is the Rule of 5, which states that if any of the following 5 member functions is explicitly defined then all of them should be explicitly defined:
- destructor
- copy constructor
- copy assignment operator
- move constructor
- move assignment operator

Also, it is a good idea to always provide a default constructor to your custom classes unless you have a really good reason not to.

zamf
Автор

this video is very important. concise and well explained. thanks!

abzrg
visit shbcf.ru