C++ lambda表达式

2018-09-25  本文已影响0人  Little熊猫

1 lambda表达式定义

lambda_declearation.png

2 lambda [] 使用

lambda_capture.png

[&epsilon] capture by reference
[&] captures all variables used in the lambda by reference
[=] captures all variables used in the lambda by value
[&, epsilon] captures variables like with [&], but epsilon by value
[=, &epsilon] captures variables like with [=], but epsilon by reference

上一篇 下一篇

猜你喜欢

热点阅读