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

Subject: [Boost-bugs] [Boost C++ Libraries] #9843: binary serializer wrong behaviour treating enums
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-07 01:55:11


#9843: binary serializer wrong behaviour treating enums
-----------------------------------------+---------------------------
 Reporter: jpjps@… | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: enum seriliazation typesize |
-----------------------------------------+---------------------------
 from iserializer.hpp
 template<class Archive>
 struct load_enum_type {
     template<class T>
     static void invoke(Archive &ar, T &t){
         // convert integers to correct enum to load
         int i;
         ar >> boost::serialization::make_nvp(NULL, i);
         t = static_cast< T >(i);
     }
 };

 it tries to load all enums int-sized.
 even in this case:
 enum class WrongBehaviour : unsigned char
 { };

 it reads 4-byte in my case, while 1 byte's expected.

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