Structs on private section.

Alexey Veselovsky alexey.veselovsky at gmail.com
Sun Nov 27 18:29:11 PST 2011


>> 
>> 
>> 
>> 
>> 
> D's private is different than some other languages (e.g. C++). 'private' provides access to the entire module.
> 
> public: no access limitation
> 
> private: access by the module
> 
> package: access by the modules of the package
> 
> protected: access by the inheriting classes

But it works even if class Foo declarated in dufferent module.

Also this code works:

module a;

private { struct S {int a;}}

--------

module b:
import a:

void f() {S s; s.a=42;}


More information about the Digitalmars-d mailing list