6 Basics [basic]

6.9 Types [basic.types]

6.9.2 Trivially copyable types [basic.types.trivial]

Each trivially copyable type T has an implementation-defined set of discrete values.
Each possible value representation of an object of type T corresponds to a distinct implementation-defined subset of this set.
The union of these subsets is the set of values; for scalar types other than object pointer types, each such subset contains no more than one value.
Certain operations cause an object to acquire a value representation, in which case the object's value is replaced with an unspecified member of the corresponding subset that would result in the program having defined behavior, if any.
[Note 1: 
A single subset for a pointer type can contain pointers to multiple objects in each of several regions of storage whose durations are disjoint.
— end note]
If an object of such a type T is not a potentially-overlapping subobject, whether or not the object holds a valid value of type T, the underlying bytes ([intro.memory]) making up the object can be copied into an array of char, unsigned char, or std​::​byte ([cstddef.syn]).²³
If the content of that array is copied back into the object, the object acquires its original value representation.
[Example 1: constexpr std::size_t N = sizeof(T); char buf[N]; T obj; // obj initialized to its original value std::memcpy(buf, &obj, N); // between these two calls to std​::​memcpy, obj might be modified std::memcpy(&obj, buf, N); // at this point, each subobject of obj of scalar type holds its original value — end example]
For two distinct such objects obj1 and obj2, if the underlying bytes ([intro.memory]) making up obj1 are copied into obj2,²⁴ obj2 acquires the value representation of obj1.
[Example 2: T* t1p; T* t2p; // provided that t2p points to an initialized object ... std::memcpy(t1p, t2p, sizeof(T)); // at this point, every subobject of trivially copyable type in *t1p contains // the same value as the corresponding subobject in *t2p — end example]
23)23)
By using, for example, the library functions ([headers]) std​::​memcpy or std​::​memmove.
24)24)
By using, for example, the library functions ([headers]) std​::​memcpy or std​::​memmove.