vault backup: 2022-06-06 10:34:20
Affected files: .obsidian/workspace 02. PARA/03. Resources(資源)/C++17/智慧指標.md
This commit is contained in:
12
.obsidian/workspace
vendored
12
.obsidian/workspace
vendored
@@ -10,7 +10,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "01. Daily/2022-06-06(週一).md",
|
"file": "02. PARA/03. Resources(資源)/C++17/智慧指標.md",
|
||||||
"mode": "source",
|
"mode": "source",
|
||||||
"source": true
|
"source": true
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outline",
|
"type": "outline",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "01. Daily/2022-06-06(週一).md"
|
"file": "02. PARA/03. Resources(資源)/C++17/智慧指標.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "search",
|
"type": "search",
|
||||||
"state": {
|
"state": {
|
||||||
"query": "gitea",
|
"query": "shared_ptr",
|
||||||
"matchingCase": false,
|
"matchingCase": false,
|
||||||
"explainSearch": false,
|
"explainSearch": false,
|
||||||
"collapseAll": false,
|
"collapseAll": false,
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "backlink",
|
"type": "backlink",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "01. Daily/2022-06-06(週一).md",
|
"file": "02. PARA/03. Resources(資源)/C++17/智慧指標.md",
|
||||||
"collapseAll": true,
|
"collapseAll": true,
|
||||||
"extraContext": true,
|
"extraContext": true,
|
||||||
"sortOrder": "alphabetical",
|
"sortOrder": "alphabetical",
|
||||||
@@ -125,6 +125,7 @@
|
|||||||
},
|
},
|
||||||
"active": "94f0e8a81af6c9e2",
|
"active": "94f0e8a81af6c9e2",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
|
"02. PARA/03. Resources(資源)/C++17/智慧指標.md",
|
||||||
"01. Daily/2022-06-06(週一).md",
|
"01. Daily/2022-06-06(週一).md",
|
||||||
"02. PARA/03. Resources(資源)/99. templates/日記.md",
|
"02. PARA/03. Resources(資源)/99. templates/日記.md",
|
||||||
"02. PARA/04. Archives(歸檔)/01. Project(專案)/004. Group firmware update check.md",
|
"02. PARA/04. Archives(歸檔)/01. Project(專案)/004. Group firmware update check.md",
|
||||||
@@ -133,7 +134,6 @@
|
|||||||
"00. TOP/01. TODO.md",
|
"00. TOP/01. TODO.md",
|
||||||
"00. TOP/00. Inbox.md",
|
"00. TOP/00. Inbox.md",
|
||||||
"README.md",
|
"README.md",
|
||||||
"test.md",
|
"test.md"
|
||||||
"02. PARA/03. Resources(資源)/Proxmox VE.md"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
6
02. PARA/03. Resources(資源)/C++17/智慧指標.md
Normal file
6
02. PARA/03. Resources(資源)/C++17/智慧指標.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
unique_ptr與shared_ptr都是智慧指標,箱對於原本的raw pointer,智慧指標使用起來更方便,也不用擔心delete的問題。
|
||||||
|
|
||||||
|
## unique_ptr
|
||||||
|
unique_ptr的特點是,它保證在一個時間內,只會有一個指標的擁有者,也就是這個指標不能被複製跟移動,當unique_ptr離開它的scope時候,它所擁有的pointer也隨之被delete。這讓你不用擔心memoo
|
||||||
|
|
||||||
|
## shared_ptr
|
||||||
Reference in New Issue
Block a user