struct's fields are all public? no access control?
Steven Schveighoffer
schveiguy at gmail.com
Fri Apr 2 15:56:43 UTC 2021
On 4/2/21 11:42 AM, Adam D. Ruppe wrote:
> On Friday, 2 April 2021 at 15:35:03 UTC, mw wrote:
>> Is this a compiler bug, or by language design?
>
> https://dlang.org/spec/attribute.html#visibility_attributes
>
> "Symbols with private visibility can only be accessed from within the
> same module. Private member functions are implicitly final and cannot be
> overridden."
>
>
> Key word there being "module".
To exapand on this, this is D's answer to "friend" functions in C++.
-Steve
More information about the Digitalmars-d
mailing list