Which rules determine whether an object is trivially copyable
问题 With the introduction of c++11, trivially copyableness has gotten quite relevant. Most notably in the use of 'std::atomic'. The basics are quite simple. A class foo is trivially copyable if: foo* src = new foo(); foo* dest = malloc(sizeof(foo)); memcpy(dest, src, sizeof(foo)); Has the same effect as: foo* src = new foo(); foo* dest = new foo(src); So an object where copying the memory will have the same effect as a copy constructor. However there, of course, is a catch. There's not only copy