Thread overview
Re: Escape analysis
Oct 29, 2008
bearophile
Oct 29, 2008
Sergey Gromov
Oct 29, 2008
Bill Baxter
Oct 29, 2008
Sergey Gromov
Oct 30, 2008
Robert Fraser
October 29, 2008
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 :-)

Bye,
bearophile
October 29, 2008
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.
October 29, 2008
On Thu, Oct 30, 2008 at 12:49 AM, Sergey Gromov <snake.scaly@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
October 29, 2008
Thu, 30 Oct 2008 04:06:52 +0900, Bill Baxter wrote:

> On Thu, Oct 30, 2008 at 12:49 AM, Sergey Gromov <snake.scaly@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
> 
> 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.

The discussed features are really a significant improvement for C++ productivity.  I think a lot of C++ code is still being written by MS so improving productivity here should be a priority for them.

I wonder if there are any chances for typeof() in C++.
October 29, 2008
On Wed, Oct 29, 2008 at 5:30 PM, Sergey Gromov <snake.scaly@gmail.com> wrote:
>
> I wonder if there are any chances for typeof() in C++.
>

It's called decltype().
October 30, 2008
Bill Baxter wrote:
> 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.

C++ is a .NET language now ;-P