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.

Reply via email to