Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9843: binary serializer wrong behaviour treating enums
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-14 05:39:45
#9843: binary serializer wrong behaviour treating enums
-------------------------------+-----------------------------------------
Reporter: jpjps@⦠| Owner: ramey
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: serialization
Version: Boost 1.55.0 | Severity: Problem
Resolution: invalid | Keywords: enum seriliazation typesize
-------------------------------+-----------------------------------------
Comment (by anonymous):
I would really sorry for the confusion caused by my comments 2,3. I
coudn't find any way to delete comments.
But we should bring the original issue. The original one is that "boost
binary archive does not consider of sized-enums. It treats all the enums
as int-sized" as described in comment 4.
So it causes some problems:
{{{
// from iserializer.hpp, load_enum_type<>::invoke<>(...):
int i;
ar >> boost::serialization::make_nvp(NULL, i); // loads as "int"
t = static_cast< T >(i); // convert it to "enum type"
}}}
When T is such
{{{
enum class PacketCode : unsigned char
{
Something,
};
}}}
Again, I sorry for bothering you.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9843#comment:6> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC