title: C++ guarantee and name for POD-like data, memcpy capable
body: <p>In another <a href="https://stackoverflow.com/questions/5430022/max-sized-array-with-normal-stl-interface-similar-to-boostarray">question</a> I incorrectly used the term POD to refer to data types that aren't actually POD types (on account of having a constructor). Now, I've looked through the standard and couldn't find a proper name for what I want. Nor can I actually find a guarantee that copying is actually allowed.</p>
  <p>The data type I mean is a POD, but may contain functions, including constructors, but nothing that should alter its alignment or size characteristics when compared to an equivalent POD type.</p>
  <p>In section 3.9 of the standard it states that POD data can be copied with memcpy, either to another object, or to character data and back. No such guarantee is ever made of non-POD data.</p>
  <p>However, the <em>object representation</em> of an object is defined in the same section. It is defined such that one would believe any two objects of the same type could be safely copied via memcpy.</p>
  <p>So my questions are:</p>
  <ol>
  <li>Is the copy with memcpy actually guaranteed to be safe for such objects?</li>
  <li>If yes, then why is there a special note about memcpy and POD?</li>
  <li>Is there a name for this type of data which is memcpy safe?</li>
  </ol>
  <hr />
  <p>A simple example of the type of object I mean:</p>
  <pre><code>struct ex_struct
  {
    int a,b,c,d;
    ex_struct() : a(123) { }
  }
  </code></pre>
  <hr />
  <p>Reading the C++0x draft, my struct would appear to be a <em>trivially copyable class</em> (9.1). I believe that implies memcpy would be safe.</p>