Re: [Boost-bugs] [Boost C++ Libraries] #1267: Assertion `new_cid == cid' failed in basic_iarchive

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1267: Assertion `new_cid == cid' failed in basic_iarchive
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-09-22 08:13:22


#1267: Assertion `new_cid == cid' failed in basic_iarchive
---------------------------------+------------------------------------------
  Reporter: mbergin_at_[hidden] | Owner: ramey
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.34.1 | Severity: Problem
Resolution: | Keywords:
---------------------------------+------------------------------------------
Comment (by anonymous):

 The short answer is:
    BOOST_IS_ABSTRACT('''const''' polymorphic_base)

 Rake are hidden in basic_xml_oarchive::save_override(nvp<T>&) method:

 {{{
     template<class T>
     void save_override(
                 #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
                 const
                 #endif
                 ::boost::serialization::nvp<T> & t,
                 int
         ){
         this->This()->save_start(t.name());
         archive::save(* this->This(), t.const_value()); /// CONST!!
         this->This()->save_end(t.name());
     }
 }}}

 nvp<T>::const_value() method allways returns constant reference and it
 doesn't matter what type you have passed to nvp<T>'s ctor.
 {{{
     const T & const_value() const {
         return *(this->second);
     }
 }}}

 So, in save_pointer_type::register_type method() the
 serialization::is_abstract<T> check is always being applied not to the
 constant type. IMHO it is better to fix serialization::is_abstract, but as
 a temporary solution additional BOOST_IS_ABSTRACT directive for constant
 type can be used.

 P.S.
 I investigated this problem with boost-1.33.1 using GCC 3.4.5 (MinGW) and
 Intel 8.0 compiler.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1267#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:49:56 UTC