Binding rvalues to ref [WAS: I close BIP27. I won't be pursuing BIPs anymore]

Manu via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 19 17:26:47 PDT 2016


On 20 October 2016 at 04:18, Namespace via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Wednesday, 19 October 2016 at 18:15:25 UTC, Jonathan M Davis wrote:
>
>> Which then causes the problem that it becomes much less clear whether ref
>> is supposed to be modifying its argument or is just trying to avoid copying
>> it - though good documentation can mitigate that problem.
>>
>> - Jonathan M Davis
>>
>
> As long as it would be marked with scope (or some similar attribute) so
> that it cannot escape, it would be fine, wouldn't it?
>

Right, I was arguing this for years. Using 'scope' to make the concept
@safe.
It seemed that it in the past the key reason for rejecting it was because
it was unsafe to pass an rvalue-temp to a function where it's unknown if
the function can cause it to outlive the function call... scope was the
obvious resolution to that (along with a lot of other issues related to
safety).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161020/78776d51/attachment.html>


More information about the Digitalmars-d mailing list