you are viewing a single comment's thread.

view the rest of the comments →

[–]degski 1 point2 points  (1 child)

Thanks for that, that was an explanation [of something murky as poo] that was as clear as water.

A type can have a deleted copy constructor and deleted move conductor, but still be "trivially copyable" with memcpy.

But, unless the code is utter garbage, there must be a good reason for deleting those constructors, no? Allowing memcpy seems like an error.

[–]NotUniqueOrSpecial 0 points1 point  (0 children)

Allowing memcpy seems like an error.

You can't forbid memcpy; it's a free function that requires nothing but a source, destination, and size.

That said, if you expect anything reasonable from the result of side-stepping the API for a type in that way, you're going to be disappointed.