DIP 1016--ref T accepts r-values--Formal Assessment

Nicholas Wilson iamthewilsonator at hotmail.com
Thu Jan 24 12:02:53 UTC 2019

On Thursday, 24 January 2019 at 09:49:14 UTC, Manu wrote:
> On Thu, Jan 24, 2019 at 1:25 AM Nicholas Wilson via We 
> discussed and concluded that one mechanism to mitigate this 
> issue
> was already readily available, and it's just that 'out' gains a 
> much
> greater sense of identity (which is actually a positive 
> side-effect if
> you ask me!).
> You have a stronger motivation to use 'out' appropriately, 
> because it
> can issue compile errors if you accidentally supply an rvalue.

True I forgot about that.

> That doesn't address the specific `atomicIncrement` case here, 
> but now
> we're in VERY niche territory; we analysed a lot of cases, and
> concluded that such cases were relatively few, and other 
> choices exist
> to mitigate those cases.
> There are cases that want to do mutation to rvalues (like in 
> pipeline
> functions), and then most cases can use 'out' instead. 
> Remaining cases
> are quite hard to find, and in this particular case, I'd 
> suggest that
> `atomicIncrement`, a very low-level implementation-detail 
> function,
> should just receive a pointer.


Oh well, I'll add this to the long list of things to make sure is 
covered at dconf by the foundation.

More information about the Digitalmars-d-announce mailing list