Sure, but then you have to unwrap the elements again when you want to use methods defined for the original type – if that it possible at all. Maybe the elements are used inside a function defined in some third-party package. It would be nice if everything could be done under the hood.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Set with type with custom equality | 3 | 173 | June 8, 2024 | |
| Set inconsistencies with structs | 4 | 516 | May 6, 2021 | |
| Create a user-type set | 2 | 619 | January 29, 2022 | |
| How to define `:(==)` on user-defined types for `Set` operations | 2 | 133 | March 3, 2025 | |
| Struct equality seems weird inside Sets | 6 | 1048 | December 5, 2020 |