|
Boost : |
Subject: Re: [boost] request for discussion - yet another approach to automated memory management that solves the cycles problem and is very efficient
From: Ilya Sokolov (ilyasokol_at_[hidden])
Date: 2009-02-27 09:50:04
Achilleas Margaritis wrote:
>> Hi Achilleas.
>>
>> Could you explain why this should work?
>
> The idea is this the following:
>
> An object is deleted if all the ptrs that point to it expired.
This statement contradicts with
> When a ptr releases an object, it checks if the object has any other ptrs
> with age older than the ptr. If not so, then it means the released ptr is
> the oldest one, and therefore the object should be deleted.
If the last one is correct, the idea seems equal to the following:
int* new_ptr;
{
std::auto_ptr<int> oldest(new int(42));
new_ptr = oldest.get();
}
*new_ptr = 43; // boom
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk