finished ch10.1

This commit is contained in:
darkicewolf50
2025-01-28 23:22:42 +00:00
parent d87328a5fc
commit b1bef1f2f6
4 changed files with 396 additions and 2 deletions

View File

@ -8,4 +8,14 @@ One of these tools is *generics*
They are abstract stand-ins for concrete types or other properties
We can express the behavior of generics or how they relate to other generics without knowing what type that will be in plcae when copiling and running the code.
We can express the behavior of generics or how they relate to other generics without knowing what type that will be in place when copiling and running the code.
Functions can either take parameters of some generic type or a concrete type (like a `i32` or `String`) in the same way they take parameters with unknwon values to run the same code on multiple concrete values
One examle where concrete values were already used was with `Option<T>`, `Vec<T>`, `HashMap<K, V>` and `Result<T, E>`
This chapter covers 3 things
1. [Reducing Code duplication](Reducing Code Duplication.md)
1. [Generics](Generics.md)
1. [Traits](Traits.md)
1. [Lifetimes](Lifetimes.md)