Dlang and POO

user1234 user1234 at 12.de
Tue Jun 22 02:37:28 UTC 2021


On Monday, 21 June 2021 at 20:18:03 UTC, christophe__c wrote:
> On Monday, 21 June 2021 at 13:09:31 UTC, Steven Schveighoffer 
> wrote:
>> On 6/21/21 6:01 AM, christophe__c wrote:
>>> Thanks in advance to all for your welcome and your answers.
>>
>> Welcome to the community!
>>
>> Just FYI, these kinds of questions should go into the [learn 
>> forum](https://forum.dlang.org/group/learn)
>>
>> And user1234's answer is correct, D's private applies to 
>> module scope, not struct/class scope. The main reason is so D 
>> can avoid the `friend` requirements of C++.
>>
>> It's also pretty reasonable, since anyone who can edit the 
>> class can also edit the rest of the file. However, it can make 
>> things difficult when proving correctness if you don't have a 
>> "one class per module" setup.
>>
>> -Steve
>
> Good evening Steve, Good evening user1234
>
> Thank you very much for your answers. I have to admit that I am 
> disappointed by this behavior.
>
> I'm sorry I posted in the wrong forum.
>
> Good evening to you.
>
> -Christophe

As suggested ("this again") this is a recurrent question. I have 
myself nothing against strict privacy but the problem is that it 
would require a new keyword as obviously nobody wants to change 
the semantics of "private".


More information about the Digitalmars-d mailing list