美文网首页
C++ lambda表达式

C++ lambda表达式

作者: Little熊猫 | 来源:发表于2018-09-25 14:20 被阅读0次

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

相关文章

网友评论

      本文标题:C++ lambda表达式

      本文链接:https://www.haomeiwen.com/subject/zsqloftx.html