Opened 17 years ago

Closed 17 years ago

#453 closed Bugs (Fixed)

polymorphic i/o archives and stl containers problem

Reported by: nobody Owned by: Robert Ramey
Milestone: Component: serialization
Version: None Severity:
Keywords: Cc:

Description

Hello,

i downloaded 1.33.0 RC1 from

http://www.osl.iu.edu/~dgregor/boost-1.33.0/

and tried to recompile some rather large projects with
it (currently using 1.32.0).
Using MS VC 7.1 and GCC 3.4.4

Doesnt work for boost::serialization:

boost::archive::polymorphic_iarchive& ar
boost::archive::polymorphic_oarchive& ar

It bumps on STL containers now:

boost\serialization\collections_load_imp.hpp(118) :
error C2039: 'reset_object_address' : is not a member
of 'boost::archive::polymorphic_iarchive'

boost\archive\polymorphic_iarchive.hpp(52) : see
declaration of 'boost::archive::polymorphic_iarchive'

---- snip "collections_load_imp.hpp" ----
// map input
template<class Archive, class Container>
struct archive_input_map
{
    inline void operator()(Archive &ar, Container &s)
    {
        #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
            typedef BOOST_DEDUCED_TYPENAME std::pair<
                BOOST_DEDUCED_TYPENAME Container::key_type,
                BOOST_DEDUCED_TYPENAME
Container::referent_type
            > type;
        #else
            typedef BOOST_DEDUCED_TYPENAME std::pair<
                BOOST_DEDUCED_TYPENAME Container::key_type,
                BOOST_DEDUCED_TYPENAME
Container::mapped_type
            > type;
        #endif
        stack_construct<Archive, type> t(ar);
        // borland fails silently w/o full namespace
        ar >> boost::serialization::make_nvp("item",
t.reference());
        std::pair<BOOST_DEDUCED_TYPENAME
Container::const_iterator, bool> result = 
            s.insert(t.reference());
        assert(result.second); // make sure we inserted
a new element
        ar.reset_object_address(& (* result.first), & t);
    }
};
---- snip "collections_load_imp.hpp" ----

"ar.reset_object_address(& (* result.first), & t);" is
called but not implemeted for these "polymorphic"
archive types?

I only found it implemented in "basic_iarchive_impl"
(and "basic_oarchive_impl" respective).

What gives?
It worked for 1.32 (because there was no
"reset_object_address" there).

Is there another (new) way to use polymorphic archive
interfaces serializing stl containers?

Regards,

A. Focht

Change History (3)

comment:1 by Robert Ramey, 17 years ago

Logged In: YES 
user_id=396141

I believe this should be corrected in the 1.33 official release.  
Let me know if you're still getting this.

Robert Ramey

comment:2 by Robert Ramey, 17 years ago

Logged In: YES 
user_id=396141

fixed in 1.33.1

comment:3 by sf-robot, 17 years ago

Status: assignedclosed
Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Note: See TracTickets for help on using tickets.