|
Boost Users : |
From: Ivan Rachev (ivanr_at_[hidden])
Date: 2005-07-16 07:10:48
Robert Ramey wrote:
> This is a different problem.
>
>
>> DynamicArray<A> ArrayOfAs;
>> ArrayOfAs.Element = new A[5];
>> ArrayOfAs.Size = 5;
>> A* secondElement = &ArrayOfAs.Element[1];
>>
>> std::stringstream stream;
>> {
>> boost::archive::text_oarchive oa(stream);
>> oa & secondElement; // new object created here
>> oa & ArrayOfAs; // attempt to reload an already loaded object
>
> to new address - throw exception - pointer conflict
>
>> }
>
>
> the following should work:
>
> oa & ArrayOfAs; // load objects into array
> oa & secondElement; // load pointer to previouslt created object
>
> Robert Ramey
>
yes, it is a different problem. Could you suggest a solution to it?
Ivan
PS: If the array comes first the problem doesn't appear.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net