Why do private member variables behaved like protected in the same module when creating deriving class?

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Mon Oct 29 23:25:42 UTC 2018


On Sunday, 28 October 2018 at 16:26:33 UTC, Stanislav Blinov 
wrote:
> On Sunday, 28 October 2018 at 16:20:06 UTC, Jesse Phillips 
> wrote:
>> On Sunday, 28 October 2018 at 15:47:15 UTC, Stanislav Blinov 
>> wrote:
>>> On Sunday, 28 October 2018 at 15:41:47 UTC, Neia Neutuladh 
>>> wrote:
>>>
>>>> In D, x is private to C and any types or functions defined 
>>>> in the same module.
>>>
>>> ...and can be accessed via reflection (.tupleof). </Pedantry>
>>
>> Actually if you try to use it the compiler complains because D 
>> reflection is compile time.
>
> Actually it doesn't complain ;)

Oh, I was thinking of when using the field names to build out 
their access. Forgot about the direct access through the tuple.


More information about the Digitalmars-d mailing list