C++11当中的的lambda和closure是同一个概念吗?
cppreference的网站上,讲述direct_initialization的时候,说道closure的参数抓取:[](){...}这个应该说是lambda的参数抓取才对吧,为什么说是闭包的参数抓取呢?
我查了一下C++11的标准文档,第一个出现closure这个词语的地方是5.1.2 lambda express,它说:
The evaluation of a lambda-expression results in a prvalue temporary (12.2). This temporary is called the
closure object. A lambda-expression shall not appear in an unevaluated operand (Clause 5). [ Note: A
closure object behaves like a function object (20.8). — end note ]
对lambda表达式求值,得到一个prvalue,这个临时对象是一个闭包对象。
请问什么叫做对lambda表达式求值,是在编译过程中,编译器的求值,还是编译生成以后,运行时的求值?
到底如何理解这一句话呢?
页:
[1]