finihed ch15.3
Some checks failed
Test Gitea Actions / first (push) Successful in 41s
Test Gitea Actions / check-code (push) Failing after 16s
Test Gitea Actions / test (push) Has been skipped
Test Gitea Actions / documentation-check (push) Has been skipped

This commit is contained in:
2025-03-04 16:55:02 -07:00
parent 78b0782ac9
commit 0052658af0
3 changed files with 221 additions and 2 deletions

View File

@ -41,7 +41,7 @@ Unlike an ordinary struct, smart pointers implements the `Deref` and `Drop` trai
The `Deref` trait allows an instance of the smart pointer struct to behave like a reference so you can write your code to with either references or smart pointers. [Section Link Here](./Deref%20Trait.md)
The `Drop` trait allows you to customize the code that is run when an instance of the smart pointer goes out of scope.
The `Drop` trait allows you to customize the code that is run when an instance of the smart pointer goes out of scope. [Section Link Here](./Drop%20Trait.md)
We will go over both traits and demonstrate why they are improtant to smart pointers.
@ -51,7 +51,7 @@ Many libraries have thier own smart pointers, and you can even write your own.
The ones we will cover are the most common smart pointers in the std library:
- [`Box<T>` for allocating values on the heap](./Using%20Box%20on%20the%20Heap.md)
- `Rc<T>`, a reference counting type that enables multiple ownership
- `Rc<T>`, a reference counting type that enables multiple ownership [Section Link Here](./Reference%20Counter%20Smart%20Pointer.md)
- `Ref<T>` and `RefMut<T>` this is accessed through `RefCell<T>`, a type that enforces the borrowing rules at runtime instead of compile time
In additon we will also cover *interior mutability* patter where an immutable tpye exposes an API for mutating an interior value.