
Matthias Troyer <troyer@phys.ethz.ch> wrote in news:E182D037-0155-4C8B-9202-5F7248CE35AB@phys.ethz.ch:
On 6 May 2007, at 17:24, Peter Dimov wrote:
Matthias Troyer wrote:
Thus, to summarize, the serialization of guid does not work since there is no serialization support for boost::array yet. This bug was masked by decalring the type primitive which works - by chance not not intent - for the text based archives. In order to fix serialization one has to
- remove the declaration as primitive type - write serialization support for boost::array - include that header
I declared the guid type as a primitive because I believed that it made sense for it to be a primitive. I only wanted 16 bytes to be written when using a binary archive. Thank you for looking in to this! I didn't know why it didn't work for binary archives or why it did work for text archives. I meant to get back to this but forgot. I had no idea that marking it primitive masked these problems and by chance it worked. I don't know a lot about the Boost Serialization library, but I want to make guids serializable. If it shouldn't be a primitive type, then I won't make it one.
Follow-up question. What needs to be included if guid::data_ is defined as unsigned char[16] instead of boost::array?
If this is best, I'll do this. No problem. I guess sometimes I go a little overboard and use boost libraries when I don't need to.
In that case the standard headers included by the archive class will have all necessary functions and no header will need to be included by the guid library
Andy.