As mikmoore mentioned, if the fields you need to modify are themselves mutable objects, you can simply use an immutable struct. If the fields you need to modify are immutable objects, then I think this post might help you choose an appropriate data structure.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Question Julia best practices for structs of numbers | 7 | 451 | January 23, 2024 | |
| Container of mutable structs without 100x slowdown? | 7 | 1244 | September 1, 2022 | |
| Structs: mutable versus immutable | 22 | 13193 | January 25, 2021 | |
| Best practices for modeling systems that evolve over time — mutability, patterns, and performance? | 26 | 651 | September 6, 2025 | |
| How is memory allocated for a vector of structs? | 9 | 479 | June 7, 2024 |