On Sunday, 2 February 2014 at 05:41:53 UTC, Andrei Alexandrescu wrote:
Sure. While you're young typecheck this:

class A {
   auto stuff() { ...; return this; }
}


Andrei

It would be a Borrowed!A, I would say, no matter how an A is allocated. A GC!A, an ARC!A and an Owning!A convert equally well to a Borrowed!A. As long as the Borrowed!A is in use (i.e. scope) after stuff() returns, the A object must not be freed (compiler enforced). Would that make sense?

Reply via email to