Robin KAY wrote:
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


Oh, cool, didn't know that. Thanks!

Reply via email to