Why can't classes with a destructor be memcpy'ed
<p>The rules of C++ say that it's legal and will work to copy an object or a <em>POD</em> type using memcpy.</p>

<p>They further say that a POD can't have a (non-trivial) destructor. Why is this and why would the mere addition of a destructor change the class in such a way that using memcpy would not work?</p>

<pre><code>// Perfectly fine to copy using memcpy
struct data
{
    int something;
    float thing;
};

// Not allowed to copy using memcpy
int var;

struct data
{
    int something;
    float thing;
    ~data() { var = 1; }
};
</code></pre>

<p>Why would simply adding the destructor make it impossible to memcpy the struct's data? I can't imagine that this would require altering the data layout in any way.</p>

<p>I'm not interested in being told don't do this, I have no intention to do so... I understand I can't do this because "the standard says so" but I'm wondering what the reason the standard says so is as it doesn't seem a necessary restriction to me and want to understand the reasons.</p>

<p><strong>EDIT</strong> People seem to be misunderstanding my question. I'm not asking if it's a good idea or not to use memcpy. I'm asking what is the reasoning behind making it illegal if there is a non-trivial destructor. I can't see what difference it makes and want to understand <em>why</em> this restriction exists. Most of the reasons I've been given about it being a bad idea apply just as much if there is a destructor or not.</p>