Escape analysis

Bill Baxter wbaxter at gmail.com
Wed Oct 29 12:06:52 PDT 2008


On Thu, Oct 30, 2008 at 12:49 AM, Sergey Gromov <snake.scaly at gmail.com> wrote:
> Wed, 29 Oct 2008 09:46:22 -0400, bearophile wrote:
>
>> I think C++ designers are fully mad, this shows how to use C++
>> lambdas:
>>
>> http://blogs.msdn.com/vcblog/archive/2008/10/28/lambdas-auto-and-static-assert-c-0x-features-in-vc10-part-1.aspx
>>
>> If D2 lambdas (and closures) become *half* complex as that I'm going
>> to stop using D on the spot :-)
>
> Well, they're somewhat limited, and a bit manual, and actually just a
> syntactic sugar, but otherwise they're quite close to D's stack
> delegates, even in syntax.  I couldn't see what scared you that much.

I think it's mostly the capture mode [] stuff that's a bit ugly.
I think this is a legal lambda:  [=,this,&x,&y](int& r) mutable { ... }

Anyway, I'm impressed that MS is getting these things into the
compiler so quickly.  I had expected to see another C99 foot-dragging
extravaganza.  Guess it just goes to show how little they care about
C.

--bb



More information about the Digitalmars-d mailing list