d- encapsulation

BCS ao at pathlink.com
Tue Mar 13 11:17:41 PDT 2007


Reply to arun,

> i want to know how the encapsulation rules works in D.
> 
> i have made a attribute as private in the class, but am able to access
> this attribute directly from the class instance...can any body give
> reason for this???
> 

If the two classes are in the same file this will happen (private only limits 
access to the module). If they are in different modules than this would be 
a bug, however IIRC there are a few bugs of this type around.





More information about the Digitalmars-d mailing list