C ++ Rule of zero and what is a constructor declared by a user?

In Transparency in the explanation , I narrowed the message.

After reading this article: The Rule of Zero ,

I understood the most, but I still want to solve some of the obscure problems that I have:

1. Looking at this phrase:

If the definition of class X does not explicitly declare the move constructor, it will be declared as implicit as default if and only if:

X does not have a user-declared copy constructor, and

X does not have a user-declared copy destination operator,

X does not have a user-declared move destination operator,

X does not have a user-declared destructor, and

The move constructor will not be implicitly defined as remote.

Should all 5 statements coexist (share "and" attitude), or only some of them (share "or" attitude)?

2. What does the user-declared "copy constructor \ instance copy operator ... mean?"

  • declares it (any of the above lists) in the .h file, but doesn't implement it as declared by the user?

  • declares it (any of the above) in the .h file and indicates " = deleted " or " = default ", announced?

  • declares it (any of the above) in an .h file with an empty bracelet, {}, is it considered a declared user?

reverence

Etay

+4
1

- , . .

, - . , "" ". , .

, , .

- pre ++ - 11. , . ++ 11 , . , , phantom, .

, , ( , ), pre ++ 11 .

+1

Source: https://habr.com/ru/post/1662772/


All Articles