Is it allowed to move a class instance object from one location to another (for example, by using std::memcpy or std::memove? Assume both source and destination locations have the same alignment. Then casting the destination "object" into the type of the source object and calling into it. What part of the C++11 standard forbids this?
You should consider the template is_trivially_copyable provided by C++11 that is useful to understand if it safe to memcpy a given type. If the value is false then the result is undefined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With