[fpc-devel] "Friend" classes?

peter green plugwash at bircd.org
Sun Mar 20 20:24:44 CET 2005

> -----Original Message-----
> From: fpc-devel-bounces at lists.freepascal.org
> [mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of DrDiettrich
> Sent: 16 March 2005 10:59
> To: FPC developers' list
> Subject: Re: [fpc-devel] "Friend" classes?
> Michael Van Canneyt wrote:
> > > type TFriendClass = class(TNotMyClass);
> >
> > This is a simple descendent.
> Yes and no. The only purpose of this declaration is to get access to the
> protected members of the class, not to extend the class in any way.
note: protected in object pascal isn't really very well protected

if you need to get at a protected method/field/property of a class you can
always do so by creating a descendent and using an unchecked typecast.

More information about the fpc-devel mailing list