21 Aug
2014
21 Aug
'14
1:26 p.m.
Andrey Semashev wrote:
Why do you think it's not sensible to have a trivial default constructor/destructor for a non-copyable class?
Because it isn't. Think about it. Trivial constructors and destructors do nothing at all. A trivial constructor leaves the object uninitialized. But it's possible I'm constrained by my lack of imagination; show me one example.
Technically, you can apply memcpy to any object and deal with the consequences.
Technically... if an object has a trivial copy constructor it's well defined to use memcpy to copy it. See 3.9/3.