April 15, 2005 struct access specifiers | ||||
---|---|---|---|---|
| ||||
private/public work inside a struct, but they have no effect on the access level of the structs members (private/public are not implemented in structs). Could access specifiers be implemented for structs? This would be great. |
April 16, 2005 Re: struct access specifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | imr1984 wrote: > private/public work inside a struct, but they have no effect on the access level > of the structs members (private/public are not implemented in structs). > > Could access specifiers be implemented for structs? This would be great. > > Confirmed. (cross-posted to bugs ng) //---------------------------------- // file a.d struct A { public int x; private char y; } //---------------------------------- // file b.d import a; void main() { A a; a.x=1; a.y='a'; } //---------------------------------- Compiles and runs when it shouldn't. -- Carlos Santander Bernal JP2, you'll always live in our minds |
Copyright © 1999-2021 by the D Language Foundation