Mike Miller says in 240. Uninitialized values and undefined behavior:
The wording in 3.9.1 [basic.fundamental] was carefully crafted to allow use of unsigned char to access uninitialized data so that memcpy and such could be written in C++ without undefined behavior
What is meant by that? Why would one want to access uninitialized data?
When you’re copying a
structwhich contains padding,memcpywill copy the padding too. Generally that padding is uninitialized.