[prev in list] [next in list] [prev in thread] [next in thread]
List: boost
Subject: Re: [boost] request for discussion - yet another approach to
From: Larry Evans <cppljevans () suddenlink ! net>
Date: 2009-02-27 21:23:28
Message-ID: go9kvn$g9d$1 () ger ! gmane ! org
[Download RAW message or body]
On 02/27/09 14:13, Achilleas Margaritis wrote:
>> This seems a serious shortcoming. To justify this, I guess you'd have
>> to somehow argue that this use-case doesn't happen very often or that
>> if it does, the user can easily detect that it happens and take
>> corrective active. Then, to justify this method vs. the use of
>> weak-ptrs, you'd have to argue why it's easier for the user to detect
>> "transferred to a newer ptr" than it is to detect where a cycle is
>> created.
>
> Indeed. I think the algorithm works for immutable ptrs only.
>
Aren't mutable ptrs necessary for creating cycles? Suppose
the ptr graph is B->A->B. (IOW, object B has pointer, B.ptr which points
to object A, and object A has pointer, A.ptr which points to B.)
Now, either A or B must be created first. When the first one is
created (suppose it's B) it can't be constructed already pointing to A
because A hasn't been created yet. Consequently, B.ptr must be mutable
in order to eventually point to A.
Am I missing something?
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic