|
Boost : |
From: Matthias Troyer (troyer_at_[hidden])
Date: 2007-05-07 15:53:21
On 7 May 2007, at 17:38, Andy wrote:
> Matthias Troyer <troyer_at_[hidden]> wrote in
> news:E182D037-0155-4C8B-9202-5F7248CE35AB_at_[hidden]:
>
>>
>> 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.
It might be easier to just add a one-line serialize function- that
does not need to pull in any header - to boost/array.hpp
Matthias
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk