vault backup: 2022-06-12 18:31:15
Affected files: .obsidian/workspace 02. PARA/03. Resources(資源)/C++17/lambda.md
This commit is contained in:
10
.obsidian/workspace
vendored
10
.obsidian/workspace
vendored
@@ -9,7 +9,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "00. TOP/01. TODO.md",
|
"file": "02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||||
"mode": "source",
|
"mode": "source",
|
||||||
"source": true
|
"source": true
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "backlink",
|
"type": "backlink",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "00. TOP/01. TODO.md",
|
"file": "02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||||
"collapseAll": false,
|
"collapseAll": false,
|
||||||
"extraContext": false,
|
"extraContext": false,
|
||||||
"sortOrder": "alphabetical",
|
"sortOrder": "alphabetical",
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outline",
|
"type": "outline",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "00. TOP/01. TODO.md"
|
"file": "02. PARA/03. Resources(資源)/C++17/lambda.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,6 +116,7 @@
|
|||||||
},
|
},
|
||||||
"active": "cfe19fa2de06a1e6",
|
"active": "cfe19fa2de06a1e6",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
|
"02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||||
"00. TOP/01. TODO.md",
|
"00. TOP/01. TODO.md",
|
||||||
"02. PARA/01. Project(專案)/未命名.md",
|
"02. PARA/01. Project(專案)/未命名.md",
|
||||||
"02. PARA/01. Project(專案)/008. Sentinel.md",
|
"02. PARA/01. Project(專案)/008. Sentinel.md",
|
||||||
@@ -124,7 +125,6 @@
|
|||||||
"attachments/Pasted image 20201206094618.png",
|
"attachments/Pasted image 20201206094618.png",
|
||||||
"attachments/para_example.png",
|
"attachments/para_example.png",
|
||||||
"attachments/Dicker Max_001.jpg",
|
"attachments/Dicker Max_001.jpg",
|
||||||
"attachments/92709501_101757388184474_261941160505769984_o.jpg",
|
"attachments/92709501_101757388184474_261941160505769984_o.jpg"
|
||||||
"attachments/2018-10-0912.49.30.png"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
19
02. PARA/03. Resources(資源)/C++17/lambda.md
Normal file
19
02. PARA/03. Resources(資源)/C++17/lambda.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
tags:
|
||||||
|
aliases:
|
||||||
|
date: 2022-06-12
|
||||||
|
time: 18:21:42
|
||||||
|
description:
|
||||||
|
---
|
||||||
|
|
||||||
|
一個簡單的 Lamdba 運算式:
|
||||||
|
```cpp
|
||||||
|
[] (int x, int y) -> bool {
|
||||||
|
return x < y;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 以中括號開頭,中括號被稱為*lamdba 導入器(lamdba introducer)*
|
||||||
|
- 小括號裡面是*lamdba 參數列表(lambda parameter list)*
|
||||||
|
- 如果沒有參數,小括號可以省略,`[] () {...}` 可以簡寫成 `[] {...}`
|
||||||
|
- 箭號(`->`)後面是回傳的型別,如果沒寫就由 `return` 自動推斷
|
||||||
Reference in New Issue
Block a user