C++ Core Guidelines: Comparison, Swap, and Hash

This post will be about comparisons, swap and hash. That means I conclude with his post my treatise about default operations rules in C++.

Read more
Tags: classes
Add CommentViews: 8027

C++ Core Guidelines: Rules for Copy and Move

The rules for copy and move are quite obvious. But before I describe them I have to write about the two remaining rules for constructors. They are about delegating and inheriting constructors.

Read more
Tags: classes
Comments 2Views: 31051

C++ Core Guidelines: 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.

Read more
Tags: classes
Comments 3Views: 42602

C++ Core Guidelines: Destructor Rules

Does my class need a destructor? I often heard this question. Most of the times the answer is no and you are fine 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.

Read more
Tags: classes
Add CommentViews: 35155

C++ Core Guidelines: The Rule of Zero, Five, or Six

This post is about the rule of zero, five, or maybe six. I will also show the difference between copy and reference semantic and a quite similar topic: deep versus shallow copy.

Read more
Tags: classes
Comments 1Views: 88993

C++ Core Guidelines: Class Rules

A class is a user-defined type where the programmer can specify the representation, the operations, and the interface. The C++ core guidelines have a lot of rules for user-defined types.

Read more
Tags: classes
Comments 3Views: 21712

C++ Core Guidelines: Semantic of Function Parameters and Return Values

Today,  I conclude my treatise about the rules to functions in the C++ core guidelines. The last post was about the syntax of function parameters and return values. This post with its roughly 15 rules is about their semantic.

Read more
Tags: functions
Comments 1Views: 11403

C++ Core Guidelines: The Rules for in, out, in-out, consume, and forward Function Parameter

You have many choices to pass function parameters. You can pass by value or by reference. A reference can be const or non-const. You can even move or forward your parameters.  Your decision should depend on if it is an in, an out, an in-out, a consume, or a forward function parameter. Curious? Read the post!

Read more
Tags: functions
Comments 1Views: 65128

C++ Core Guidelines: Function Definitions

Functions are the "fundamental building block of programs."  and "the most critical part in most interfaces."  These statements introduce the rules to function of the C++ core guidelines. Of course, both statements are absolutely right. So, lets dive deeper into the more than 30 rules for defining functions, passing arguments to functions, and returning values from functions.

Read more
Tags: functions
Comments 2Views: 13800

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 5113

All 2175103

Currently are 90 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments