what about
void fun(ref int);
fun(1.lvalueof);
previous work : https://wiki.dlang.org/DIP39
The lvalueof
property could create a temporary variable if the exp it's used on is not already a lvalue, otherwise it would do nothing.
Thread overview | |||||
---|---|---|---|---|---|
|
May 09, 2022 `lvalueof` property on rvalues | ||||
---|---|---|---|---|
| ||||
what about
previous work : https://wiki.dlang.org/DIP39 The |
May 12, 2022 Re: `lvalueof` property on rvalues | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Monday, 9 May 2022 at 14:03:21 UTC, Basile B. wrote: >[...] create a temporary variable if the exp it's used on is not already a lvalue, otherwise it would do nothing. That's what happens if you supply the
There is also So what is the advantage of having to add -- Bastiaan. |
May 12, 2022 Re: `lvalueof` property on rvalues | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bastiaan Veelo | On Thursday, 12 May 2022 at 08:06:14 UTC, Bastiaan Veelo wrote: >On Monday, 9 May 2022 at 14:03:21 UTC, Basile B. wrote: >[...] create a temporary variable if the exp it's used on is not already a lvalue, otherwise it would do nothing. That's what happens if you supply the
There is also So what is the advantage of having to add -- Bastiaan. Ok, I was not aware of that. It's would be indeed useless if D can already do that implictly. |