Awesome! It can be wrapped into a macro for nicer syntax. Great solution.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Initialization of mutable structs with many default values | 7 | 4722 | November 25, 2018 | |
| Using mutable struct constructor | 2 | 564 | March 21, 2022 | |
| Simple parametric type question | 22 | 1105 | November 14, 2018 | |
| Default constructor for any type? | 94 | 3214 | February 29, 2024 | |
| Named argument variant of `new` or some other way to initialize a `mutable struct` efficiently *and* "readable"? | 14 | 828 | December 9, 2021 |