Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2007-01-09 02:28:24

Bugs item #1631210, was opened at 2007-01-08 23:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: serialization
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Robert Ramey (ramey)
Summary: serialization of classes with overloaded operator & fails

Initial Comment:
the serialization of the following class fails to compile
at line 363 in detail/iserializer.hpp, struct load_standard, method invoke, line
void * x = & const_cast<typex &>(t);

class wrapped_value
        const int* operator & ()
        { // returns the address of the wrapped integer, which may noy be the same as the address of the instance
                return &a;

        template <typename Archive>
        void serialize(Archive& ar, const unsigned version)
                ar & a;
        int a;

due to the overloaded '&' operator getting the address of the instance fails. a proposed patch is
void * x = boost::addressof( const_cast<typex &>(t) );

which seems to compile and work correctly



You can respond by visiting:

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at