|
Boost Users : |
Subject: Re: [Boost-users] [serialization] [multimap] change of element's order when deserialize
From: Pablo Madoery (madoerypablo_at_[hidden])
Date: 2014-04-09 12:06:08
Thank you for your quick answer. I think I will use a map of vector instead
of a multimap.
On Wed, Apr 9, 2014 at 12:18 PM, Robert Ramey <robertmacleranramey_at_[hidden]
> wrote:
>
>
> On Wednesday, April 9, 2014 7:45:59 AM UTC-7, Pablo Madoery wrote:
>>
>> I have the following code:
>>
>
>
>> snip ...
>>
>> where you can see that the element's order is changed.
>>
>> When compiling it throw this warning:
>> boost::mpl::print<boost::serialization::BOOST_
>> SERIALIZATION_STATIC_WARNING_LINE<98> >
>>
>
> that I don't know what it means.
>
> You'll have to look into source code error stack to see the comment
> associated with this warning.
>
>
>>
>> Is this a normal behavior of the serialization library?
>> I am missing something ?
>>
>
> This is a feature of the implementation of the serialization of multi map
> as well as the implementation
> of the std::multi map itself. The result is correct in that it's a valid
> multimap but it is a different one that the original.
> You could say it's an equivalent multimap. Should this have been done
> differently? probably not. Trying
> to guarantee this level of "equality" would couple the serialization
> implementation to the
> std::multimap implementation. This would add much work and never could be
> entirely relied upon.
>
> If you want a specific order - don't use multi map. Expend your key size
> and use map or set
>
> Robert Ramey
>
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net