On Borrow Checking
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Thu May 1 02:51:35 UTC 2025
On 01/05/2025 2:28 PM, Richard (Rikki) Andrew Cattermole wrote:
> ```d
> void func(RC input) {
> input.add; // elidable
> scope(exit)
> input.sub; // elidable
>
> if (condition) {
> input.sub;
> input = RC(...);
> input.add;
> }
> }
> ```
Ok that example is bad, no sub oops.
I came up with this optimization solution a long time ago and may have
forgot a few things.
More information about the Digitalmars-d
mailing list