Created on1998-09-15.00:00:00 last changed277 months ago
Proposed Resolution (04/99):Change the text in 6.8 [basic.types]paragraph 2 from:
For any complete POD object typeT, ...to:
For any object (other than a base class subobject) of POD typeT, ...Change the text in 6.8 [basic.types] paragraph 3from:
For any POD typeT, if two pointers toTpoint to distinctT objectsobj1 andobj2,to:
For any POD typeT, if two pointers toTpoint to distinctT objectsobj1 andobj2,where neitherobj1 norobj2 is a base class subobject,...
Can you use memcpy on non-member POD subobjects of non-POD objects?
In 6.9 [basic.types]paragraphs 2 and 3 we have:
For any complete POD object typeT, whether or not the objectholds a valid value of typeT, the underlying bytes(6.8.1 [intro.memory]) makingup the object can be copied into an array ofcharorunsigned char*. If the content ofthe array ofchar orunsigned char is copied back into the object, theobject shall subsequently hold its original value.[Example elided]Paragraph 3 doesn't repeat the restriction of paragraph 2. Should it beassumed? Otherwise only complete POD types are copyable to an array ofchar and back, but scribbling over subobjects is OK.(Or perhaps a "distinctT object" is a complete object...)*[Footnote: By using, for example, the library functions(16.4.2.3 [headers])memcpy ormemmove.end footnote]For any POD typeT, if two pointers toT pointto distinctT objectsobj1andobj2, if the value ofobj1 is copied intoobj2, using thememcpy libraryfunction,obj2 shall subsequently hold the same value asobj1.
Proposed Resolution (04/99):Change the text in 6.9 [basic.types]paragraph 2 from:
For any complete POD object typeT, ...to:
For any object (other than a base class subobject) of POD typeT, ...Change the text in 6.9 [basic.types] paragraph 3from:
For any POD typeT, if two pointers toTpoint to distinctT objectsobj1 andobj2,to:
For any POD typeT, if two pointers toTpoint to distinctT objectsobj1 andobj2,where neitherobj1 norobj2 is a base class subobject,...
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2003-04-25 00:00:00 | admin | set | status: dr -> tc1 |
| 1999-09-14 00:00:00 | admin | set | messages: +msg205 |
| 1999-09-14 00:00:00 | admin | set | status: review -> dr |
| 1998-09-15 00:00:00 | admin | create | |