[Issue 8845] Can't pass immediate or rvalue args to ref function parameters

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 24 07:13:49 PDT 2016


Nick Treleaven <ntrel-pub at mybtinternet.com> changed:

           What    |Removed                     |Added
                 CC|                            |ntrel-pub at mybtinternet.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=9238

--- Comment #20 from Nick Treleaven <ntrel-pub at mybtinternet.com> ---
(In reply to Manu from comment #0)
> I've heard arguments about the safety of the operation, but the 'workaround'
> is just to create a temporary, which has identical security properties.
> ...
> Perhaps this behaviour could be restricted to ref const, or ref in, if we're
> getting worried about the safety of the operation? That would perhaps even
> improve on how behaves now.

I think rvalues could be passed to const ref parameters so long as that
parameter is not return ref. The reason is in case we decide to support local
refs initialized from a return ref function.


More information about the Digitalmars-d-bugs mailing list