Title
Layout-compatible POD-struct types
Status
tc1
Section
12.2 [class.mem]
Submitter
Steve Adamczyk

Created on 1999-12-20.00:00:00 last changed 208 months ago

Messages

Date: 2000-04-15.00:00:00

Proposed resolution (10/00):

In 12.2 [class.mem] paragraphs 14 and 15, change all occurrences of "members" to "nonstatic data members."

Date: 2004-09-10.00:00:00

The definition of layout-compatible POD-struct types in 12.2 [class.mem] paragraph 14 requires that the two types

have the same number of members, and corresponding members (in order) have layout-compatible types (3.9).
There does not appear to be any reason for including member functions and static data members in this requirement. It would be more logical to require only that the non-static data members of the two types must match.

The characteristics of layout-compatible types are not well described in the current wording, either. Apart from their use in 12.2 [class.mem] paragraph 16 to define the term "common initial sequence," there appears to be nothing said about which operations are possible between objects of layout-compatible types. For example, 6.9 [basic.types] paragraphs 2-3 give certain guarantees regarding use of memcpy on objects of the same type; it might be reasonable to assume that the same kinds of guarantees might apply to objects of layout-compatible types, but that is not said. Similarly, 6.10 [basic.lval] paragraph 15 describes permissible "type punning" but does not mention layout-compatible types.

History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetmessages: + msg311
2000-05-21 00:00:00adminsetstatus: open -> ready
1999-12-20 00:00:00admincreate