[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-bugs
Subject:    [Boost-bugs] [Boost C++ Libraries] #3233: serialization problem:
From:       "Boost C++ Libraries" <noreply () lists ! boost ! org>
Date:       2009-06-29 15:16:07
Message-ID: 064.d1fc03a0bda542862f16a1570a085e09 () lists ! boost ! org
[Download RAW message or body]

#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.
_______________________________________________
Boost-bugs mailing list
Boost-bugs@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-bugs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic