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

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3233: serialization problem: enum : __int64
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-07-29 11:18:30


#3233: serialization problem: enum : __int64
----------------------------------------------+-----------------------------
  Reporter: dcb_BanDos <ban_dos@…> | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: Boost 1.40.0 | Component: serialization
   Version: Boost 1.39.0 | Severity: Problem
Resolution: wontfix | Keywords: __int64 enum serialization
----------------------------------------------+-----------------------------

Comment(by Dmitry <ban_dos@…>):

 {{{
 #!c
 namespace boost
 {
         namespace archive
         {
                 namespace detail
                 {
                         template<class Archive>
                         struct save_enum_type<Archive, CGenericParamParam>
                         {
                                 static void invoke(Archive &ar, const
 CGenericParamParam & param)
                                 {
                                         // convert enum to integers on
 save
                                         const __int64 i =
 static_cast<__int64>( param );
                                         ar <<
 boost::serialization::make_nvp(NULL, i);
                                 }
                         };

                         template<class Archive>
                         struct load_enum_type<Archive, CGenericParamParam>
                         {
                                 static void invoke(Archive &ar,
 CGenericParamParam & param)
                                 {
                                         // convert integers to correct
 enum to load
                                         __int64 i = 0;
                                         ar >>
 boost::serialization::make_nvp(NULL, i);
                                         param =
 static_cast<CGenericParamParam>(i);
                                 }
                         };
                 }
         }
 }
 }}}

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