March 03, 2015
On Tuesday, 3 March 2015 at 00:47:01 UTC, Andrei Alexandrescu wrote:
>> This does not solve anything as postblit only increase refcount so it
>> does not make any sense that it deletes the payload.
>
> Yah, it's opAssign instead of postblit. -- Andrei

So it is an auto expanding arena, and when all refcount go to 0, the whole arena is blasted, is that right ?

Sounds like it can work, but that means very few outside phobos will build upon this.
March 03, 2015
On Monday, 2 March 2015 at 20:40:45 UTC, deadalnix wrote:
> On Monday, 2 March 2015 at 20:36:53 UTC, Marc Schütz wrote:
>> Interesting approach. I will have to think about that. But I think it does not really work. Your example hides the fact that there are actually two types involved (or can be): an RC wrapper, and the actual class. foo() would need to take at least `c1` as the wrapper type `RC!C`, not `C` itself, otherwise it couldn't copy it. But that defeats the purpose of borrowing, that it neutralizes the actual memory management strategy; foo() should know whether `c1` is reference counted or not.
>
> Please reread. I'm assuming a refcounting system like Andrei's proposal for objects.

Then you're in the wrong thread ;-)

>
> The result would be the same for a RefCounted wrapper (a solution that I would prefer) in the sense you'd have to copy the wrapper to get ownership of it before being able to assign to it.

1 2 3 4 5 6
Next ›   Last »