C++ Core Guidelines: More Rules for Expressions
I know this post’s headline is a bit boring: More Rules for Expressions. Honestly, this post is about code hygiene because I will mainly write about pointers.
This author has not written his bio yet.
But we are proud to say that Rainer Grimm contributed 656 entries already.
I know this post’s headline is a bit boring: More Rules for Expressions. Honestly, this post is about code hygiene because I will mainly write about pointers.
Today’s post is about expressions. You should avoid complicated expressions, know the precedence rules for arithmetic or logical expressions, and know the order of evaluation of expressions. The main reasons for undefined behavior are having the wrong precedence rules for expressions in mind or assuming an evaluation order for expressions that is just wrong or […]
In this post, I will finish the rules for declarations. The remaining rules for declarations are not especially sophisticated but important for high code quality.
Let’s continue our tour through the rules for expressions and statements in the C++ core guidelines. This post will be about declarations and initializations.
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.