Opened 13 years ago

Closed 13 years ago

#3638 closed Bugs (fixed)

de-serialization of shared_ptr

Reported by: anonymous Owned by: Robert Ramey
Milestone: Boost 1.42.0 Component: serialization
Version: Boost Development Trunk Severity: Problem
Keywords: serialization shared_ptr Cc:

Description

De-serialization of shared_ptr does not compile anymore. (This code did compile in 1.40.0)

Attachments (1)

serbug.cpp (848 bytes ) - added by Christoph Duelli 13 years ago.
de-serializataion of shared_ptr fails to compile (Boost 1.41); linux gcc 4.2.1

Download all attachments as: .zip

Change History (3)

by Christoph Duelli, 13 years ago

Attachment: serbug.cpp added

de-serializataion of shared_ptr fails to compile (Boost 1.41); linux gcc 4.2.1

comment:1 by emilm@…, 13 years ago

Temporary fix is to make the serialized class polymorphic by adding at least one polymorphic function (ex. the destructor). To fix this you need to patch boost/archive/shared_ptr_helper.hpp and at line 111 after return add an &. So,

    return &boost::serialization::singleton<
    ... 

instead of

    return boost::serialization::singleton<
    ... 

comment:2 by Robert Ramey, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk - will migrate to release when tests pass

Robert Ramey

Note: See TracTickets for help on using tickets.