vault backup: 2022-06-13 21:39:21

Affected files:
.obsidian/workspace
02. PARA/03. Resources(資源)/C++17/lambda.md
This commit is contained in:
2022-06-13 21:39:21 +08:00
parent 2d22f1ebeb
commit 08e568d9e5
2 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ auto comapre = [] (int x, int y) -> bool {
```
## Lamdba的擷取子句
以中括號開頭的 *lamdba 導入器*可以將外部的變數傳給 Lamdba 運算式正式名稱是「擷取子句capture clause」。
以中括號開頭的 *lamdba 導入器* 可以將外部的變數傳給 Lamdba 運算式正式名稱是「擷取子句capture clause」。
`[=]` 表示它們會以值擷取captured by value。Scope內的變數可以在 lamdba 內使用,但是不可以改變。
`[&]` 表示它們會以參考擷取captured by reference。Scope內的變數可以在 lamdba 內使用,可以改變。