alias this question

Jacob Carlborg doob at me.com
Thu Feb 17 02:41:23 PST 2011


On 2011-02-16 20:42, Christopher Nicholson-Sauls wrote:
> On 02/13/11 10:30, Olli Aalto wrote:
>> I encountered a problem with alias this, when the aliased member is
>> private. I'm using the latest dmd2. It reports the follwing:
>> src\main.d(14): Error: struct K.K member s is not accessible
>>
>> If I change the private modifier on the s member to public it works.
>>
>> Is this as intended, or a bug?
>>
>> O.
>>
>
> There is actually an alternative, but I believe I remember it being said
> that this would go away.  In the meantime, I think it still works and
> maybe it could be saved.
>
> The alternative is to define a method opDot() which returns the entity
> to forward the call to.
>
> Check out std.typecons:Unique for an example.
>
> -- Chris N-S

Isn't opDot deprecated in favor of opDispatch?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list