summaryrefslogtreecommitdiff
path: root/Cloning a box does a deep copy of the heap data.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-08-05 08:53:21 +0200
committerJasper Ras <jras@hostnet.nl>2025-08-05 08:53:21 +0200
commit295b343aecf330e830d79f06e0efc511e7d76da1 (patch)
tree85057ef1fe401adcd0d958ddf6ff966f25d8fef0 /Cloning a box does a deep copy of the heap data.md
parentf43372529e655f3b039946c969e4465193eb2042 (diff)
vault backup: 2025-08-05 08:53:21
Diffstat (limited to 'Cloning a box does a deep copy of the heap data.md')
-rw-r--r--Cloning a box does a deep copy of the heap data.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/Cloning a box does a deep copy of the heap data.md b/Cloning a box does a deep copy of the heap data.md
new file mode 100644
index 0000000..25c861d
--- /dev/null
+++ b/Cloning a box does a deep copy of the heap data.md
@@ -0,0 +1,7 @@
+[[Rust]]
+[[Ownership]]
+[[Moved heap data principle]]
+
+---
+
+To get around the issue of not being able to use a box after we moved ownership we can call .clone() on it. A clone is a deep copy of the heap data rather than just a shallow copy of the pointer to the original heap data. \ No newline at end of file