Re: [Boost-bugs] [Boost C++ Libraries] #9843: binary serializer wrong behaviour treating enums

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9843: binary serializer wrong behaviour treating enums
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-10 08:37:16


#9843: binary serializer wrong behaviour treating enums
-------------------------------+-----------------------------------------
  Reporter: jpjps@… | Owner: ramey
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords: enum seriliazation typesize
-------------------------------+-----------------------------------------

Comment (by anonymous):

 brought more straightfoward case:
 {{{
         enum class PacketCode : unsigned char
         {
                 Something,
         };
         PacketCode packetcode;

         //no exception
         std::istringstream stream(std::string(4, 0));
         binary_iarchive archive(stream, boost::archive::no_header);
         archive >> packetcode;

         //exception. it tries to read 4 bytes
         stream = std::istringstream(std::string(1, 0));
         archive >> packetcode;
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9843#comment:4>
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