in reply to Storing object references internally

The consequence of this would be that the code creating the Foo object cannot simply dereference it to invoke destruction.

Just a usage micro-nit: to "dereference" means to access the value pointed to by a reference, which I think is different from what you intend in the excerpt above. It's a term that one sees more often in connection with, e.g., C pointers. E.g. if x is a C-pointer, then the expression *x is said to "dereference" the pointer. And, drawing an implicit analogy between such pointers and Perl references, $$x may be described as a "dereferencing" of scalar ref $x, for example. (Naturally, such dereferencing does not invoke the destruction of the reference or its referent.)

the lowliest monk

  • Comment on Re: Storing object references internally