请教,关于lambda函数的实现问题
请教,关于lambda函数的实现问题
在C++11之前,boost库已经实现了lambda函数的语法,如下面这个例子:
#include <iostream>#include "boost/lambda/lambda.hpp"#include "boost/function.hpp"int main() { using namespace boost::lambda; (std::cout << _1 << " " << _3 << " " << _2 << "!\n") ("Hello","friend","my"); boost::function<void(int,int,int)> f= std::cout << _1 << "*" << _2 << "+" << _3 << "=" <<_1*_2+_3 << "\n"; f(1,2,3); f(3,2,1);}