DIP1000: The return of 'Extend Return Scope Semantics'
sighoya
sighoya at gmail.com
Tue May 25 21:47:58 UTC 2021
On Tuesday, 25 May 2021 at 11:24:59 UTC, Dennis wrote:
> ```D
> // Mike Franklin's proposal:
> void move(T)(return(target) T source, ref scope T target)
>
> // Steven Schveighoffer's proposal:
> void move(T)(return T source, @__sink ref scope T target)
> ```
>
> What do you think?
I prefer Mike's proposal, too. It is more readable to some who
isn't that involved in the topic, like me :) for instance.
As a compromise, what about this?:
```D
void move(T)(@__source return T source, @__sink ref scope T
target)
```
```D
void move(T)(@__source("sourceA") return T sourceA,
@__sink("targetA") ref scope T targetA, @__source("sourceB")
return T sourceB, @__sink("targetB") ref scope T targetB)
```
More information about the Digitalmars-d
mailing list