Filter for opDispatch?

frame frame86 at live.com
Sun May 16 04:07:15 UTC 2021


On Sunday, 16 May 2021 at 03:19:04 UTC, Mike Parker wrote:
> On Sunday, 16 May 2021 at 00:04:39 UTC, frame wrote:
>
>>
>> Yes, but why should the derived class not have access to it?
>
> I don't think that's your problem. From the template docs:
>
>> _TemplateInstances_ are always instantiated in the scope of 
>> where the _TemplateDeclaration_ is declared...
>
> Your `opDispatch` templates are instantiated in the scope of 
> `Base`, from which `_s` is not accessible when it's protected.

Indeed, the error goes away if each derived class has its own 
implementation.

But the same with fields work? They are also protected.


More information about the Digitalmars-d-learn mailing list