Adding constructor to third party class/struct definition
<p>A third party library has structs defined as</p>

<pre><code>typedef struct _Example
{
  int member;
} Example;
</code></pre>

<p>As a side question, just out of interest, why that definition? Why not <code>struct Example { ... }</code>?</p>

<p>Anyhow, I want to serialize the information with boost::serialization, and for that need a constructor. Is it safe to just change my version of the 3rd party header file by adding a constructor to the struct definition? Or alternatively, to just copy that definition to my own code base, rename it, add a constructor, and reinterpret_cast to it?</p>

<p>I assume it would be because as I understand functions and constructors shouldn't change the underlying byte layout of the class/struct, is this correct?</p>

<p>Thanks</p>
