There are nine rules to access objects in class hierarchies. Let's have a closer look.
I needed three posts to present the 20 rules for class hierarchies in the C++ core guidelines. Here are the seven remaining rules.
In the last post, I started our journey with the rules of class hierarchies in modern C++. The first rules had a pretty general focus. This time, I will continue our journey. Now, the rules have a closer focus.
Let's talk in this post about rules for class hierarchies in general and in particular. The C++ core guidelines have about thirty rules; therefore, I have a lot to discuss.
I can not think about modern C++ without lambda expressions. So my wrong assumption was that there are many rules for lambda expressions. Wrong! There are fewer than ten rules. But as ever I learned something new.
This post will be about comparisons, swap, and hash. That means I conclude with his post my treatise about default operations rules in C++.
The rules for copy and move are pretty obvious. But before I describe them I have to write about the two remaining rules for constructors. They are about delegating and inheriting constructors.
The lifecycle of each object starts with its creation; therefore, this post will be about the thirteen most fundamental rules for objects: constructor rules.
Does my class need a destructor? I often heard this question. Most of the time the answer is no and you are okay with the rule of zero. Sometimes the answer is yes and we are back to the rule of five. To be more precise. The guidelines provide eight rules for destructors.
This post is about the rule of zero, five, or maybe six. I will also show the difference between copy and reference semantics and a quite similar topic: deep versus shallow copy.
Hunting
Today 1727
Yesterday 4344
Week 38605
Month 18851
All 12097060
Currently are 164 guests and no members online
Kubik-Rubik Joomla! Extensions
Read more...
Read more...