www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21243] New: Allow lambdas to return auto ref

https://issues.dlang.org/show_bug.cgi?id=21243

          Issue ID: 21243
           Summary: Allow lambdas to return auto ref
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: snarwin+bugzilla gmail.com

Nested functions (to which lambdas are lowered) already support this, so
lambdas should too.

This will make it possible to, for example, enclose an arbitrary expression in
a  trusted lambda without needing to check first whether the expression
evaluates to an lvalue or an rvalue.

--
Sep 13 2020