Re: [Boost-bugs] [Boost C++ Libraries] #3747: Not possible to split derived classes in several files

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3747: Not possible to split derived classes in several files
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-12-14 08:19:33


#3747: Not possible to split derived classes in several files
--------------------------------------------------+-------------------------
  Reporter: Runar Undheim <r.undheim@…> | Owner: ramey
      Type: Bugs | Status: reopened
 Milestone: Boost 1.42.0 | Component: serialization
   Version: Boost 1.41.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------------------+-------------------------
Changes (by Runar Undheim <r.undheim@…>):

  * status: closed => reopened
  * resolution: invalid =>

Comment:

>Did you actually try to use the files I sent you?
 Yes
>That is, does the exact test which passes on my setup fail on yours?
 No, but with a little change in the code I mange to get the problem.
 I updated the main class to also keep an instance of the Object class:

 {{{
 #include "serializationDerived.hpp"

 class Main : public Base {
     friend class boost::serialization::access;
     template<class Archive>
         void serialize(Archive & ar, const unsigned int version)
     {
         ar & boost::serialization::base_object<Base>(*this);
         ar & m_objects;
         ar & m_object;
     }

 public:

     std::vector<Base*>
         m_objects;
     Object
       m_object;

     Main(
     )
     {
     }
 };
 }}}

 This code create problem. If I move both BOOST_CLASS_EXPORT registration
 into the main.cpp, then it works again. So it seems that the error is
 dependent on the order that the static classes are initiated.[[BR]]
 1) Should it be allowed to both serialize an instance and a pointer to a
 class?[[BR]]
 2) Should it be possible to split the serialization classes into different
 files?[[BR]]

>Just perusing serializationDerived.3.cpp shows an obvious error ...
 serializationDerived.3.cpp include the export files through the header
 file serializationDerived.hpp.

> PS. The fact that something may have worked...
 If the code worked in 1.40 it would reduce the number of blunders in the
 code. But we should find out if it is a bug or just a side effect. If it
 is a side effect is should probably be mention in the documentation:
 Differences from Boost 1.40.

 Runar Undheim

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3747#comment:4>
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:02 UTC