Impressive: C++ Lambdas via Template Metaprogramming

Tue 13 April 2010

U. Utah's Matt Might has implemented lambda expressions in C++, so for instance:

    Function2<int,int,int> h(int a, int b) {
     return lambda<int> (x,y) --> a*x + b*y ;
    }

the value of h(3,4)(1,1) is 7.

blogroll

social