Problem with "delete" and what about "friend" classes & functions?

%u u at digitaldaemon.com
Fri Jan 5 16:20:43 PST 2007


== Auszug aus John Kiro (johnkirollos at yahoo.com)'s Artikel
> So any idea about the reason of this error?

You protected a pointer variable in a class with a getter.
Now you want to delete the object rooted in that pointer variable
from outside the class containing the pointer variable, thereby
leaving the value stored in that pointer variable unmodified.

This means you want that pointer variable in the class to have an
invalid address---to point to an object which does not exist
anymore.

The D compiler allows you to shoot in your foot if you really
really want to.


More information about the Digitalmars-d-learn mailing list