jeudi 8 juin 2017

Rule of 3 Default Member Deprecation in C++11

According to the below widely-known table, automatic compiler generation of default copy constructor, copy assignment, and destructor is deprecated in C++11 when either or both of the copy assignment and copy constructor is/are supplied by the user (the red cells indicate deprecation). This makes perfect sense in light of the "Rule of 3". However, the table shows that generation of copy members is not deprecated in the case of a user-supplied destructor.

What is the rationale behind this design decision?

Reference Table

Aucun commentaire:

Enregistrer un commentaire