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:
8
.obsidian/workspace
vendored
8
.obsidian/workspace
vendored
@@ -9,7 +9,7 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "02. PARA/03. Resources(資源)/C++17/C++17.md",
|
||||
"file": "02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||
"mode": "source",
|
||||
"source": true
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "02. PARA/03. Resources(資源)/C++17/C++17.md",
|
||||
"file": "02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
@@ -86,7 +86,7 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "02. PARA/03. Resources(資源)/C++17/C++17.md"
|
||||
"file": "02. PARA/03. Resources(資源)/C++17/lambda.md"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,8 +116,8 @@
|
||||
},
|
||||
"active": "cfe19fa2de06a1e6",
|
||||
"lastOpenFiles": [
|
||||
"02. PARA/03. Resources(資源)/C++17/C++17.md",
|
||||
"02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||
"02. PARA/03. Resources(資源)/C++17/C++17.md",
|
||||
"02. PARA/03. Resources(資源)/C++17/以值擷取(captured-by-value).md",
|
||||
"02. PARA/03. Resources(資源)/C++17/以值擷取(captured.md",
|
||||
"00. TOP/01. TODO.md",
|
||||
|
||||
@@ -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 內使用,可以改變。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user