Binding rvalues to const ref in D

Manu via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 20 07:49:02 PDT 2016


On 20 October 2016 at 21:07, Ethan Watson via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Thursday, 20 October 2016 at 10:36:16 UTC, Manu wrote:
>
>> DIP25 introduced return ref to address this issue. Just annotate it
>> correctly?
>>
>
> I mean, it'll work, but it's not the most secure method to rely on the
> programmer remembering to do it.
>

True, but isn't that just the case for any extern function? I mean, extern
functions are just like that; gotta type the signature right :)
Not sure it's worth runtime logic to attempt to check that someone typed
the signature incorrectly...? It's certainly not the only way users could
bugger up the extern declaration and cause any number of similar problems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161021/d4ebe88a/attachment.html>


More information about the Digitalmars-d mailing list