======== struct S { ref S foo() return { return this; } }
void main() { S().foo().foo().foo(); } ========If I write it like "auto foo(S s) { return s; }" then statement in main() will copy value of S three times and I want to avoid this.
Andrey Zherikov via Digitalmars-d-learn Fri, 18 Sep 2020 11:25:50 -0700
======== struct S { ref S foo() return { return this; } }
void main() { S().foo().foo().foo(); } ========If I write it like "auto foo(S s) { return s; }" then statement in main() will copy value of S three times and I want to avoid this.