Re: [Boost-bugs] [Boost C++ Libraries] #10727: polymorphic serialization of shared_ptr fails

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10727: polymorphic serialization of shared_ptr fails
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-12-18 09:44:12


#10727: polymorphic serialization of shared_ptr fails
-------------------------------+---------------------------
  Reporter: oswin.krause@… | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.56.0 | Severity: Regression
Resolution: fixed | Keywords:
-------------------------------+---------------------------

Comment (by anonymous):

 and a minimal example:

 #include <boost/shared_ptr.hpp>
 #include <boost/archive/polymorphic_text_iarchive.hpp>
 #include <fstream>
 #include <boost/serialization/shared_ptr.hpp>
 #include <boost/serialization/vector.hpp>//something to de-serialize
 int main(){
 std::ifstream i("foo");
     boost::archive::polymorphic_text_iarchive ia(i);
     boost::archive::polymorphic_iarchive & ia_interface = ia;
     boost::shared_ptr<std::vector<int> > p;
     ia_interface >> p;
 }

 boost version
 #define BOOST_VERSION 105700

 error

 In file included from /home/ulfi/feyidata/main.cpp:6:0:
 /usr/include/boost/serialization/shared_ptr.hpp: In instantiation of 'void
 boost::serialization::load(Archive&, boost::shared_ptr<U>&, unsigned int)
 [with Archive = boost::archive::polymorphic_iarchive; T =
 std::vector<int>]':
 /usr/include/boost/serialization/split_free.hpp:58:22: required from
 'static void boost::serialization::free_loader<Archive,
 T>::invoke(Archive&, T&, unsigned int) [with Archive =
 boost::archive::polymorphic_iarchive; T =
 boost::shared_ptr<std::vector<int> >]'
 /usr/include/boost/serialization/split_free.hpp:74:38: required from
 'void boost::serialization::split_free(Archive&, T&, unsigned int) [with
 Archive = boost::archive::polymorphic_iarchive; T =
 boost::shared_ptr<std::vector<int> >]'
 /usr/include/boost/serialization/shared_ptr.hpp:187:57: required from
 'void boost::serialization::serialize(Archive&, boost::shared_ptr<U>&,
 unsigned int) [with Archive = boost::archive::polymorphic_iarchive; T =
 std::vector<int>]'
 /usr/include/boost/serialization/serialization.hpp:128:27: required from
 'void boost::serialization::serialize_adl(Archive&, T&, unsigned int)
 [with Archive = boost::archive::polymorphic_iarchive; T =
 boost::shared_ptr<std::vector<int> >]'
 /usr/include/boost/archive/detail/iserializer.hpp:188:5: [ skipping 2
 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
 /usr/include/boost/archive/detail/iserializer.hpp:410:13: required from
 'static void
 boost::archive::detail::load_non_pointer_type<Archive>::load_standard::invoke(Archive&,
 const T&) [with T = boost::shared_ptr<std::vector<int> >; Archive =
 boost::archive::polymorphic_iarchive]'
 /usr/include/boost/archive/detail/iserializer.hpp:462:28: required from
 'static void
 boost::archive::detail::load_non_pointer_type<Archive>::invoke(Archive&,
 T&) [with T = boost::shared_ptr<std::vector<int> >; Archive =
 boost::archive::polymorphic_iarchive]'
 /usr/include/boost/archive/detail/iserializer.hpp:618:24: required from
 'void boost::archive::load(Archive&, T&) [with Archive =
 boost::archive::polymorphic_iarchive; T =
 boost::shared_ptr<std::vector<int> >]'
 /usr/include/boost/archive/polymorphic_iarchive.hpp:107:40: required
 from 'void boost::archive::polymorphic_iarchive_impl::load_override(T&,
 int) [with T = boost::shared_ptr<std::vector<int> >]'
 /usr/include/boost/archive/detail/interface_iarchive.hpp:60:9: required
 from 'Archive&
 boost::archive::detail::interface_iarchive<Archive>::operator>>(T&) [with
 T = boost::shared_ptr<std::vector<int> >; Archive =
 boost::archive::polymorphic_iarchive]'
 /home/ulfi/feyidata/main.cpp:13:21: required from here
 /usr/include/boost/serialization/shared_ptr.hpp:170:9: error: 'class
 boost::archive::polymorphic_iarchive' has no member named 'get_helper'
          );

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10727#comment:3>
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:17 UTC