4 ms·
Thanks for the interesting pointer. I was also thinking in the direction of the compiler transforming the call-by-value struct object argument into a call-by-r
by yvdriess 7y ago
Thanks for the interesting pointer.
I was also thinking in the direction of the compiler transforming the call-by-value struct object argument into a call-by-ref one at specific call sites. e.g. when the object is clearly on the caller's stack, is not mutated by the function and the function is not taking its address.
As Walter pointed out, you can use refs in BetterC (and of course C++) directly, but I don't see why it cannot be automatically applied to C in general.