vault backup: 2022-06-13 19:14:15
Affected files: .obsidian/workspace 02. PARA/03. Resources(資源)/C++17/lambda.md
This commit is contained in:
6
.obsidian/workspace
vendored
6
.obsidian/workspace
vendored
@@ -117,14 +117,14 @@
|
||||
"active": "cfe19fa2de06a1e6",
|
||||
"lastOpenFiles": [
|
||||
"02. PARA/03. Resources(資源)/C++17/lambda.md",
|
||||
"02. PARA/03. Resources(資源)/C++17/以值擷取(captured-by-value).md",
|
||||
"02. PARA/03. Resources(資源)/C++17/以值擷取(captured.md",
|
||||
"00. TOP/01. TODO.md",
|
||||
"02. PARA/01. Project(專案)/未命名.md",
|
||||
"02. PARA/01. Project(專案)/008. Sentinel.md",
|
||||
"02. PARA/03. Resources(資源)/99. templates/front matter.md",
|
||||
"02. PARA/03. Resources(資源)/Obsidian.md",
|
||||
"attachments/Pasted image 20201206094618.png",
|
||||
"attachments/para_example.png",
|
||||
"attachments/Dicker Max_001.jpg",
|
||||
"attachments/92709501_101757388184474_261941160505769984_o.jpg"
|
||||
"attachments/para_example.png"
|
||||
]
|
||||
}
|
||||
@@ -202,7 +202,7 @@ auto findInRange = [&, numlist](int32_t start, int32_t end) {
|
||||
反之,如果已經使用了 `&`,就不可以再參考擷取其他變數,像是 `[&, &var1]` 就是不合法的。
|
||||
|
||||
### 存取 class
|
||||
Lamdba 寫在 class 裡面的時候,不論「以值擷取」或是「以參考擷取」都沒辦法傳遞成員變數(member variable),只能傳遞 `this`,透過 `this` 來存取成員變數。例:
|
||||
Lamdba 寫在 class 裡面的時候,不論「以值擷取 」或是「以參考擷取」都沒辦法傳遞成員變數(member variable),只能傳遞 `this`,透過 `this` 來存取成員變數。例:
|
||||
```cpp
|
||||
class BigBuffer {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user