Can someone explain this paragraph of an existing standard C ++ 0x draft?

Can someone explain this statement from ISO N3242 ยง3.2, paragraph 2

Unallocated distribution or release function for class odr - used by definition a constructor of this class. the deallocation function for the class uses the odr definition of the destructor of this class or by selecting search at the definition point for the virtual destructor (12.4) .26 A copy assignment function for the class is an odr-used implicit copy-assignment function for another class, as specified in 12.8 . the move-assign function for a class is an odr-used implicitly defined call forwarding function for another class, as specified in 12.8.

ISO 2003 standard:

The copy function for a class is used implicitly in the copy-assign function for another class, as specified in 12.8.

What is the actual difference in these statements?

Anyone explain the above point in the example / program ...?

I know the constructor move / move function -> a new function is added.

Can someone explain this with an example / program?

you are welcome.............

please .......... answer

+6
source share
1 answer

The rationale for this addition, with examples, can be found here . In short, this is a refinement of when the allocation / deallocation function for a class should be defined.

Rule (C ++ 03) One Definition requires that every variable or function that is used in a program must have exactly one definition for a very specific definition of "use." Therefore, a description of when the distribution function (de) is considered "used" also requires when a definition is required.

To avoid confusion between the general meaning of the word โ€œuseโ€ and the meaning of โ€œuseโ€ as defined in ODR, the word โ€œuseโ€ is replaced with โ€œodr-useโ€ whenever a second meaning is implied.

+4
source

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


All Articles