On 1/31/19 4:46 PM, Olivier FAURE wrote:
On Thursday, 31 January 2019 at 18:31:22 UTC, Steven Schveighoffer wrote:
BTW, the DIP discusses how to annotate these rare situations:
int doubleMyValue(ref int x) { ... }
@disable int doubleMyValue(int x);
I don't think that's a solution. The problem is in the getter method,
not in doubleMyValue. If nothing else, since the DIP is designed to work
on existing functions, it could happen on doubleMyValue functions which
would be both designed by and used by people completely unaware of
DIP-1016.
How is the problem not in doubleMyValue? It's sole purpose is to update
an lvalue. It is the perfect candidate to mark with @disable for rvalues.
-Steve