rvalues -> ref (yup... again!)

Timon Gehr timon.gehr at gmx.ch
Wed Mar 28 11:50:44 UTC 2018


On 28.03.2018 13:34, Timon Gehr wrote:
> On 27.03.2018 20:14, Manu wrote:
>> That's exactly what I've been saying. For like, 9 years..
>> It looks like this:
>> https://github.com/TurkeyMan/DIPs/blob/ref_args/DIPs/DIP1xxx-rval_to_ref.md 
>>
>>   (contribution appreciated)
>>
>> As far as I can tell, it's completely benign, it just eliminates the
>> annoying edge cases when interacting with functions that take
>> arguments by ref. There's no spill-over affect anywhere that I'm aware
>> of, and if you can find a single wart, I definitely want to know about
>> it.
> 
> ???
>  >> I've asked so many times for a technical destruction, nobody will
>> present any opposition that is anything other than a rejection *in
>> principle*. This is a holy war, not a technical one.
> 
> That's extremely unfair. It is just a bad idea to overload D const for 
> this purpose. Remove the "const" requirement and I'm on board.

"The proposal could be amended to accept mutable ref's depending on the 
value-judgement balancing these 2 use cases. Sticking with const 
requires no such value judgement to be made at this time, and it's much 
easier to relax the spec in the future with emergence of evidence to do so."

Just get it right the first time. "const" is a serious API restriction, 
and it shouldn't be forced on anyone, even intermittently until they 
figure out that it is too restrictive (as well as viral).


More information about the Digitalmars-d mailing list