Skip to content

Commit

Permalink
update note
Browse files Browse the repository at this point in the history
  • Loading branch information
hxf0223 committed Aug 19, 2024
1 parent f0e0274 commit f4fbeef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _posts/2024-08-13-std-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ int main() {
## 5. lambda 表达式
`lambda`表达式是一个匿名`函数对象`,即编译器会创建一个匿名对象,并将外部捕获的变量,添加到该匿名对象中。这些是`lambda`的额外开销。
`lambda`表达式是一个匿名`函数对象`,即编译器会创建一个`仿函数`( 调用时,调用 `operator()(....)` ),并将外部捕获的变量,添加到该匿名对象中。这些是`lambda`的额外开销。
注:在`O2`编译时,仿函数也会被优化掉,直接编译成跳转代码段。
```cpp
int main()
Expand Down

0 comments on commit f4fbeef

Please sign in to comment.