D perfomance

Walter Bright newshound2 at digitalmars.com
Sun Apr 26 02:22:30 UTC 2020


On 4/25/2020 4:00 PM, Timon Gehr wrote:
> What's an example of such an optimization and why won't it introduce UB to @safe 
> code?

     @live void test() { int a,b; foo(a, b); }

     @live int foo(ref int a, ref int b) {
         a = 0;
         b = 1;
         return a;
     }

ref a and ref b cannot refer to the same memory object.


More information about the Digitalmars-d mailing list