Clean C++
I want to make a short detour from my long series of posts about the C++ Core Guidelines. I read the excellent book “Clean C++” in the last few days and I cannot hesitate to write a review. Here is my review.
This author has not written his bio yet.
But we are proud to say that Rainer Grimm contributed 702 entries already.
I want to make a short detour from my long series of posts about the C++ Core Guidelines. I read the excellent book “Clean C++” in the last few days and I cannot hesitate to write a review. Here is my review.
There are many rules in the C++ Core Guidelines dealing with expressions and statements. To be precise, there are more than 50 rules about declarations, expressions, statements, and arithmetic expressions.
Passing smart pointers is a critical topic that is seldom addressed. This ends with the C++ core guidelines because they have six rules for passing std::shared_ptr and std::unique_ptr.
There were a lot of C++ experts who said that smart pointers were the essential feature of C++11. Today, I will write about smart pointers in C++.
I have prepared the pdf bundle. To get it is quite simple.
The guidelines have six rules for explicit memory allocation and deallocation. Six! Maybe you are surprised because there is a simple rule in modern C++: don’t use new and delete. The story is not so simple.
This and the following posts will probably be about the most critical concern in programming: resource management. The C++ Core Guidelines have rules for resource management in general but also rules for allocation and deallocation and smart pointers in particular. Today I will begin with the general rules of resource management.
The section to enumerations has eight rules. Since C++11, we have scoped enumerations which overcome a lot of the drawbacks of classical enumerations.
Now, it’s time to choose the next pdf bundle? You will get all posts, all source files, and a cmake file to the chosen topic.
A union is a particular data type where all members start at the same address. A union can hold only one type at a time; therefore, you can save memory. A tagged union is a union that keeps track of its types.
