Ok I got a bit further on this. In the example I attached earlier, if I make the base class non-abstract and remove the BOOST_IS_ABSTRACT(base) specialization, it "works". However this will kill the use of serialization for me :-( Is is_abstract<base> interacting in a mean way with shared_ptr? PS: Sorry for the post format, can't figure out outlook webmail -----Original Message----- From: boost-users-bounces@lists.boost.org on behalf of Sohail Somani Sent: Tue 3/27/2007 4:12 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [serialization] Assertion `new_cid==cid'failed-fails on gcc, works on msvc
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Robert Ramey Sent: Tuesday, March 27, 2007 2:39 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [serialization] Assertion `new_cid ==cid'failed-fails on gcc, works on msvc
Note that serialize a poly morphic shared pointer requires a little bit of gymnastics. Check out the "test_shared_ptr" and the source of serialization/shared_ptr.hpp
I think I've followed the documentation, but the attached test still triggers an assertion when deserializing on gcc 3.2.2: $ ./build/stage/bin/test_serialize Serialized form: 22 serialization::archive 3 0 1 2 7 derived 1 0 0 1 0 1 10 derived id test_serialize: basic_iarchive.cpp:466: const boost::archive::detail::basic_pointer_iserializer* boost::archive::detail::basic_iarchive_impl::load_pointer(boost::archive ::detail::basic_iarchive&, void*&, const boost::archive::detail::basic_pointer_iserializer*, const boost::archive::detail::basic_pointer_iserializer*(*)(const boost::serialization::extended_type_info&)): Assertion `new_cid == cid' failed. Aborted This assertion does not trigger occur on Visual C++ 7.1. Can you spot if I'm doing something obviously silly?