Overriding Private

dsimcha dsimcha at yahoo.com
Mon May 11 21:38:41 PDT 2009


Is there any hack in D that will allow overriding of privacy settings on
classes?  For example, I really need a feature that will force D to let me
mess with the internals of a class that I have no control over from a
subclass, effectively making private members protected.

I know this is a bad idea, yada yada yada, but I feel like a language that
allows manual memory management, casting away immutable, and inline assembler
should allow some backdoor to cast away private.  Is this anywhere?  If not,
we should really consider including a cast(public) or something in the spirit
that, ultimately, the programmer knows what he/she is doing and the language
should treat the programmer like a consenting adult.



More information about the Digitalmars-d mailing list