我想知道 boost 如何实现 Lambda 库。我正在深入研究实施,但感觉就像我掉进了兔子洞......
有人可以简要解释一下以下代码片段的工作原理吗(取自此处)?
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
using namespace boost::lambda;
typedef std::istream_iterator<int> in;
std::for_each(
in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
Run Code Online (Sandbox Code Playgroud)
创建一个期待 int 的函子对象的幕后发生了什么?
谢谢
| 归档时间: |
|
| 查看次数: |
388 次 |
| 最近记录: |