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

ShadoLight ettienne.gilbert at gmail.com
Wed Jul 25 09:11:08 UTC 2018


On Saturday, 21 July 2018 at 08:59:39 UTC, Manu wrote:
> On Sat, 21 Jul 2018 at 00:15, Johannes Loher via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>>
>> On Saturday, 21 July 2018 at 05:59:37 UTC, Manu wrote:
>> > [...]
>>
>> Let me give a concrete example of one of the situations 
>> Jonathan is describing. Consider the following code:

[Snip]

>>
>> Do you think this example in contrived? If yes, why?

[Snip]

> There are countless ways you can construct the same bug. ref 
> doesn't
> contact this problem in a general way, so a solution to this 
> class of
> problem shouldn't be ref's responsibility.

[Snip]

>
> ... I don't understand how the existing rule can be so 
> zealously defended in the face of a
> bunch of advantages, when all other constructions of the exact 
> same
> problem are silently allowed, and literally nobody complains 
> about them ever!

+1000

Very well and elegantly argued Manu.

I also notice that nobody that opposes this DIP has bothered to 
address the inconsistency that you raised above, i.e. the current 
acceptance of the same behaviour in other constructions, but 
somehow oppose this DIP for the exact same behaviour.






More information about the Digitalmars-d mailing list