diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-08-08 22:44:15 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-08-08 22:44:15 +0200 |
commit | 22675cd8dc75d8b8d4b0f818f5b093efbc364802 (patch) | |
tree | 90156d37dccf13f012d535e7d92273259e3d5c17 /Creating a reference to a variable is called borrowing.md | |
parent | 295b343aecf330e830d79f06e0efc511e7d76da1 (diff) |
Diffstat (limited to 'Creating a reference to a variable is called borrowing.md')
-rw-r--r-- | Creating a reference to a variable is called borrowing.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Creating a reference to a variable is called borrowing.md b/Creating a reference to a variable is called borrowing.md index 245d060..2790d63 100644 --- a/Creating a reference to a variable is called borrowing.md +++ b/Creating a reference to a variable is called borrowing.md @@ -8,6 +8,6 @@ Creating a reference is done with an ampersand. It creates a pointer to another variable in the stack, which could be a pointer to something on the heap. -This is called borrowing. +This is called borrowing. ( Borrow, but not own, its heap data so to speak? ) A reference is a non-owning pointer; so if we create a reference to a Box we can safely have it discarded and continue using the box because the heap data is not deallocated.
\ No newline at end of file |