Re: [Boost-bugs] [Boost C++ Libraries] #5679: boost::serialization::primitive_type used with polymorphic archive fails to compile

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5679: boost::serialization::primitive_type used with polymorphic archive fails to compile
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-31 17:44:43


#5679: boost::serialization::primitive_type used with polymorphic archive fails to
compile
----------------------------------+-----------------------------------------
  Reporter: boost@… | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.47.0 | Severity: Problem
Resolution: invalid | Keywords: uuid serialization polymorphic
----------------------------------+-----------------------------------------
Changes (by ramey):

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

Comment:

 I don't think it is possible to fix this.

 Here is the short explanation of the polymorphic archive concept.

 a) One compiles his serialization implementations against the
 polymorphic_oarchive class. This means that your classes will be saved to
 any kind of output archive with out instantiating any new code. This
 applies for all future and past output archive classes.

 b) marking a type as "primitive" indicates that the code for doing the
 serialization is to be found in the set of functions which are compiled in
 the .._oprimitive.hpp file.

 c) If one would add now "primitive" types to a polymorphic archive - this
 would totally defeat the original goal of the polymorphic archive.

 In a nutshell - instantiating code for your own class at the
 ..._oprimitive level is incompatiable with the polymorphic oarchive idea
 that we can use the already made archives without doing any new
 instantiation.

 I realize that this is not at all clear in the explanation of the
 polymorphic archives. When I first looked at your code I thought it was a
 bug. It was only after an hour (or more!) of experimentation that I came
 to this understanding.

 Thanks for taking the time to prepare your test case. I'll put a little
 bit of the explanation in the documentation.

 Robert Ramey

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