vault backup: 2022-06-06 10:34:20

Affected files:
.obsidian/workspace
02. PARA/03. Resources(資源)/C++17/智慧指標.md
This commit is contained in:
2022-06-06 10:34:20 +08:00
parent fd5c54fbfa
commit fc6b4647aa
2 changed files with 12 additions and 6 deletions

12
.obsidian/workspace vendored
View File

@@ -10,7 +10,7 @@
"state": {
"type": "markdown",
"state": {
"file": "01. Daily/2022-06-06(週一).md",
"file": "02. PARA/03. Resources資源/C++17/智慧指標.md",
"mode": "source",
"source": true
}
@@ -23,7 +23,7 @@
"state": {
"type": "outline",
"state": {
"file": "01. Daily/2022-06-06(週一).md"
"file": "02. PARA/03. Resources資源/C++17/智慧指標.md"
}
}
}
@@ -52,7 +52,7 @@
"state": {
"type": "search",
"state": {
"query": "gitea",
"query": "shared_ptr",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
@@ -81,7 +81,7 @@
"state": {
"type": "backlink",
"state": {
"file": "01. Daily/2022-06-06(週一).md",
"file": "02. PARA/03. Resources資源/C++17/智慧指標.md",
"collapseAll": true,
"extraContext": true,
"sortOrder": "alphabetical",
@@ -125,6 +125,7 @@
},
"active": "94f0e8a81af6c9e2",
"lastOpenFiles": [
"02. PARA/03. Resources資源/C++17/智慧指標.md",
"01. Daily/2022-06-06(週一).md",
"02. PARA/03. Resources資源/99. templates/日記.md",
"02. PARA/04. Archives歸檔/01. Project專案/004. Group firmware update check.md",
@@ -133,7 +134,6 @@
"00. TOP/01. TODO.md",
"00. TOP/00. Inbox.md",
"README.md",
"test.md",
"02. PARA/03. Resources資源/Proxmox VE.md"
"test.md"
]
}

View File

@@ -0,0 +1,6 @@
unique_ptr與shared_ptr都是智慧指標箱對於原本的raw pointer智慧指標使用起來更方便也不用擔心delete的問題。
## unique_ptr
unique_ptr的特點是它保證在一個時間內只會有一個指標的擁有者也就是這個指標不能被複製跟移動當unique_ptr離開它的scope時候它所擁有的pointer也隨之被delete。這讓你不用擔心memoo
## shared_ptr