The rule of zero, or six, is one of the advanced rules in modern C++. I wrote in my current book "C++ Core Guidelines Explained: Best Practices for Modern C++" about them. Today, I want to quote the relevant parts of my book in this post.
static_assert allows you to check at compile time if a type T fulfills the Concept: static_assert(Concept<T>).
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.
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.
Hunting
Today 3608
Yesterday 6374
Week 31232
Month 221308
All 11702462
Currently are 184 guests and no members online
Kubik-Rubik Joomla! Extensions
Read more...
Read more...