DIP 1016--ref T accepts r-values--Community Review Round 1

Johnatune s at s.cum
Sat Jul 21 19:29:46 UTC 2018


I was for this back when it was only for 'const ref' but that 
somehow changed to just ref. Which I think is a mistake. Yes D's 
const is broken and useless, but I don't think that's a reason to 
introduce difficult to locate bugs with the addition of this 
feature. There's not a simple way to locate where code might be 
breaking if a temporary value is being passed to a ref function 
when it wasn't intended. Right now this is a compiler error, even 
in C++. But with this proposed change it might take a lengthy 
amount of time in the debugger trying to understand what is 
happening.

Yes I want rvalue refs, just not like this.


More information about the Digitalmars-d mailing list