I have a data structure that looks like this:
typedef struct
{
unsigned short m_short1;
unsigned short m_short2;
unsigned char m_character;
} MyDataType;
>
I thought I'd share this with anyone who was trying to serialize a C++ struct using Boost. For the example given above, to make the struct serializable you would add a serialize function:
typedef struct
{
unsigned short m_short1;
unsigned short m_short2;
unsigned char m_character;
template
void serialize(Archive& ar, const unsigned int version)
{
ar & m_short1;
ar & m_short2;
ar & m_character;
}
} MyDataType;