> A unique_ptr can't be aliased at all.

Well, that's not really true, and not how I code C++. You can alias a 
unique_ptr by calling .get(). I would then dereference and pass the reference 
into subroutine calls. Those calls have a reference, so they know it's 
non-null, and by convention they assume the caller knows what he's doing.

So when the unowned ref-counting if "off" (in a "release" build), it's the same 
as what I do in C++, very efficient.

When the unowned ref-counting is "on", effectively it's like running a memory 
checker on the unowned refs. If they are used after the owned ref is destroyed, 
that's an error. valgrind/purify would give you the same information.

At least, that's my understanding.

Reply via email to