Version française
Home     About     Download     Resources     Contact us    
Browse thread
Stroustrup et al. propose to introduce "lambda closures" in C++
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eijiro Sumii <eijiro.sumii@g...>
Subject: Stroustrup et al. propose to introduce "lambda closures" in C++
Hi,

A friend of mine informed me of this report

    Lambda expressions and closures for C++
    Jeremiah Willcock, Jaakko Jarvi, Doug Gregor, Bjarne Stroustrup,
Andrew Lumsdaine
    2006-02-26
    http://public.research.att.com/~bs/N1968-lambda-expressions.pdf

and I thought you might be interested.  (I searched a little and
didn't find any discussion on this report in this list.)

A few highlights:

----------------------------------------------------------------------

    We propose to extend the C++ language with lambda expressions, and
define the semantics of these unnamed local functions via translation
to closures: function objects implemented using local classes.

...

    void f() {
      int sum = 0;
      for each(a.begin(), a.end(),
        <>(int x) -> int extern(sum) {return sum += x;});
    }

...

    2.1 Omitting the return type
    The return type of a lambda expression can be omitted if the body
of the lambda function contains at most one return statement.

----------------------------------------------------------------------

Enjoy:-),

        Eijiro