DIP 1021--Argument Ownership and Function Calls--Community Review Round 1

aliak something at something.com
Fri Jul 19 11:04:43 UTC 2019


On Friday, 19 July 2019 at 08:32:13 UTC, Mike Franklin wrote:
> void main() @safe
> {
>     doSomething(foo(), bar());
> }
>
> How can the compiler statically determine whether `foo` and 
> `bar` will return a reference to the same data?
>
> It seems the language or type system must provide this 
> guarantee, which would require a full-fledged 
> ownership/borrowing system to accurately enforce what this DIP 
> is proposing.

 From what I understand it won't with this dip. foo and bar do not 
refer to the same "memory object"


More information about the Digitalmars-d mailing list