[Boost-bugs] [Boost C++ Libraries] #3233: serialization problem: enum : __int64

Subject: [Boost-bugs] [Boost C++ Libraries] #3233: serialization problem: enum : __int64
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-29 15:16:07


#3233: serialization problem: enum : __int64
---------------------------------------------+------------------------------
 Reporter: dcb_BanDos <ban_dos@…> | Owner: ramey
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: serialization
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: __int64 enum serialization |
---------------------------------------------+------------------------------
 I have a enum and structure:
 {{{
 #!c
 typedef enum : unsigned __int64 {
     epUnknown = 0x0,
         epCpuSystem = 0x0001LL,
 ....
          epAvgCpu= 0x100000000LL
 } CGenericParamParam;

 struct fee
 {
 ....
  CGenericParamParam param;
 }
 }}}
 Then i try to serialize this structure into
 boost::archive::binary_oarchive via boost::serialization:

 {{{
 #!c
 template<class Archive, class T>
 struct save_enum_type
 {
     static void invoke(Archive &ar, const T &t){
         // convert enum to integers on save
         const int i = static_cast<int>(t);
         ar << boost::serialization::make_nvp(NULL, i);
     }
 };
 }}}
 Casting __0x100000000LL
  into int gives 0.
 Any ideas?

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