Questions tagged [rule-of-zero]

Classes that have custom destructors, copy/move constructors or copy/move assignmentoperators should deal exclusively with ownership. Other classes should not have custom destructors, copy/move constructors or copy/move assignment operators.

To quote the original article:

Classes that have custom destructors, copy/move constructors or copy/move assignmentoperators should deal exclusively with ownership. Other classes should not have custom destructors, copy/move constructors or copy/move assignment operators.

The idiom was created by Martinho Fernandes in one of his blog-posts.

16 questions
0
votes
0 answers

Rule of 5 - Compiles without assignment operator

In an effort to understand the move operator when dealing with a member that is an array, I wrote the following development test. Why does this work and/or compile when I've violated the rule of 5 by not implementing an assignment or a move…
Christopher Pisz
  • 3,757
  • 4
  • 29
  • 65
1
2