cast(public)

Robin KAY komadori at gekkou.co.uk
Sat Jul 18 02:36:22 PDT 2009


Robert Clipsham wrote:
> struct Foo {
>    private uint bar;
> }
> 
> void main() {
>    Foo foo;
>    foo.bar++;  // This works for me with dmd 1.026,
>                // dmd 2.031 and ldc r1411
>    // foo.bar is now 1.
> }
> ----
> 
> Same effect for classes... Am I missing something or is this a bug?

None of the protection attributes have any effect within a module. 
Members of the same module are always "friends".

See: http://www.digitalmars.com/d/2.0/attribute.html#ProtectionAttribute

-- 
Robin KAY



More information about the Digitalmars-d mailing list