alias function this - limitations

div0 div0 at users.sourceforge.net
Thu Jun 24 11:52:26 PDT 2010


On 24/06/2010 19:23, Simen kjaeraas wrote:
> div0 <div0 at users.sourceforge.net> wrote:
>
>>> This code fails on the line 'int b = f;'. Is it supposed to?
>>>
>>
>> I think so.
>>
>> 'alias this' is used to forward stuff that appears to the right of a
>> dot onto the named member.
>
> Not only. Assignment of the wrapped type will also work.

Yes, I can see your intent and I think it should probably be made to 
work that way.

I've been having a play and as far as I can tell it looks like aliasing 
this to a method just doesn't work at all; I think the alias this is 
being completely ignored.

> I feel that alias this is currently broken, but hope it will be fixed.

It will be given time. We also could do with multiple alias this 
allowed, would make porting certain styles of c++ template code much easier.

-- 
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


More information about the Digitalmars-d-learn mailing list