Re: [Boost-bugs] [Boost C++ Libraries] #4681: can't serialize protected derived class

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4681: can't serialize protected derived class
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-09-27 15:25:05


#4681: can't serialize protected derived class
-----------------------------------+----------------------------------------
  Reporter: mark.r.buda@… | Owner: ramey
      Type: Feature Requests | Status: new
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.40.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------

Comment (by mark.r.buda@…):

 I took BOOST_CLASS_EXPORT_GUID and split it into two macros, removing the
 namespace bits:

 {{{#!cpp
 #define BOOST_CLASS_EXPORT_PROTECTED_1(T) \
   static ::boost::archive::detail::guid_initializer< T > const \
   & guid_initializer; \

 #define BOOST_CLASS_EXPORT_PROTECTED_2(W, T, K) \
   ::boost::archive::detail::guid_initializer< W::T > const & \
   W::guid_initializer = \
            ::boost::serialization::singleton< \
                ::boost::archive::detail::guid_initializer< W::T > \
>::get_mutable_instance().export_guid(K) \
 /**/

 class foo {
   protected:
     class bar {
     // ...
     };
     BOOST_CLASS_EXPORT_PROTECTED_1(foo::bar)
 };

 BOOST_CLASS_EXPORT_PROTECTED_2(foo, bar, "foo::bar")
 }}}

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