Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-10-26 18:20:22


Are you by any chance using draft #20 with boost_1-31?

Currently, I don't have load_object_ptr anymore in the code. It fell a way
when I made adjustments to accommodate ADL.

My original intention was that load_object_ptr be overloadible for just this
reason. I can't remember why it was on a TODO list.

In any case, it seems to me that there is (or was) an obstacle to using a
class specific new. The current system uses a global new operator or a
stack_allocator to allocate the requisite amount of memory then uses
placement new to initialize it. This turned out to be more convenient in
particular situations - specifically serialization of the STL library. So,
any class specific new would probably not be invoked. I'm not sure how to
handle this in general - I suspect there is no general solution.

I suppose you could use something like the following:

class x {
    y *m_y;
    template<class Archive>
    load(Archive& ar){
        m_y = new y;
        ar >> m_y;
    }
};

but of course this would evade the free object tracking for serialized
pointers

I really haven't thought about this much.

Robert Ramey

"Andreas Huber" <ahd6974-spamgroupstrap_at_[hidden]> wrote in message
news:clmgq8$urs$1_at_sea.gmane.org...
> Hi Robert
>
> Under release.html#todo you say that it is currently not possible to use
> serialization with types that define their own new/delete operators. In
> serialialization.html#constructors you describe a technique how types
> that do not possess a default constructor can be serialized. Given the
> design of load_object_ptr and load_construct_data it seems that this is
> easily possible, namely by overloading load_object_ptr. I'm therefore
> wondering whether the remark under release.html#todo is outdated or
> whether I'm missing something.
>
> Regards,
>
> --
> Andreas Huber
>
> When replying by private email, please remove the words spam and trap
> from the address shown in the header.
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk