CopyMemory Non-POD
<p>I have structs and vectors that looks like:</p>

<pre><code>typedef struct
{
    int SX, SY;
    int X, Y, Z;
    std::vector&lt;Vector3D&gt; Vertices;
    const void* VBOPointer;
} Model;

typedef struct
{
    int X, Y;
    struct
    {
        int VX[4], VY[4];
        int TX[4], VY[4];
    } Quad;
} Item;

std::vector&lt;Item&gt; ListOfItems;
std::vector&lt;Model&gt; ListOfModels;
</code></pre>

<p>I need to copy these to memory so I can reconstruct them from another program. I've mapped the memory already but then I realized that I cannot use CopyMemory or MemCpy on any of them.</p>

<p>How can I copy it?</p>

<p>Example of how I copy standard data types/structs:</p>

<pre><code>struct
{
    int X;
    int Y;
} POD;

//pData is a void pointer to mapped memory given to be by MapFileView..

POD Foo = {100, 50};
long double* Data = static_cast&lt;long double*&gt;(pData);
//Check if Data[1] contains a request command then copy.

CopyMemory(&amp;Data[0], &amp;Foo, sizeof(Foo));
</code></pre>
