This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


383. Is a class with a declared but not defined destructor a POD?

Section: Clause 11  [class]     Status: CD1     Submitter: Gennaro Prota     Date: 18 Sep 2002

[Voted into WP at March 2004 meeting.]

The standard (Clause 11 [class] par. 4) says that "A POD-struct is an aggregate class that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor."

Note that it says 'user-defined', not 'user-declared'. Is it the intent that if e.g. a copy assignment operator is declared but not defined, this does not (per se) prevent the class to be a POD-struct?

Proposed resolution (April 2003):

Replace in Clause 11 [class] paragraph 4

A POD-struct is an aggregate class that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined declared copy assignment operator and no user-defined declared destructor. Similarly, a POD-union is an aggregate union that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined declared copy assignment operator and no user-defined declared destructor.

Drafting note: The changes are shown relative to TC1, incorporating the changes from the resolution of core issue 148.