This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Voted into WP at October, 2009 meeting.]
Thestd::memcpy library function is singled out forspecial treatment in 6.9 [basic.types] paragraph 3:
For any trivially copyable typeT, if two pointers toT point to distinctT objectsobj1 andobj2, where neitherobj1 norobj2 is abase-class subobject, if the value ofobj1 is copied intoobj2, using thestd::memcpy library function,obj2 shall subsequently hold the same value asobj1.
This specification should not be restricted tostd::memcpybut should apply to any bytewise copying, includingstd::memmove (as is done in the footnote in the precedingparagraph, for example).
Proposed resolution (July, 2009):
Change 6.9 [basic.types] paragraph 3 as follows:
For any trivially copyable typeT, if two pointers toT point to distinctT objectsobj1 andobj2, where neitherobj1 norobj2 is abase-class subobject, if thevalue ofunderlying bytes(6.8.1 [intro.memory]) making upobj1isare copied intoobj2, using thestd::memcpy library function[Footnote: Byusing, for example, the library functions (16.4.2.3 [headers])std::memcpy orstd::memmove.—end footnote],obj2 shall subsequentlyhold the same value asobj1. [Example:...