Deprecating this(this)

Per Nordlöw per.nordlow at gmail.com
Sun Apr 1 12:23:29 UTC 2018


On Sunday, 1 April 2018 at 01:56:40 UTC, Jonathan M Davis wrote:
> Another potential issue is whether any of this does or should 
> relate to
>
> https://github.com/dlang/DIPs/pull/109
>
> and it's solution for hooking into to moves. I'm not at all 
> sure that what happens with that needs to be related to this at 
> all, but it might.
>
> - Jonathan M Davis

And before we think about `opMove` we should, IMO, make the 
compiler pass by move in more cases, for instance, in range 
constructors such as

this(Source source)
{
     this.source = source; // last occurrence of `source` can be 
moved
}

I'd be happy to help out with adding this in dmd. Andrei has 
already showed interest in this idea.


More information about the Digitalmars-d mailing list