I think all the parameterizations of your struct would compile down to the same thing, the only difference is when you dispatch on it and do something with the contained type parameter. I don’t know why you’d do this in the case you showed, but it might be helpful to “tag” similar structs in that way for some purposes.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
No method matching error when calling generic constructor with concrete implementer of abstract type | 15 | 807 | January 12, 2021 | |
Problem with parametric composite types | 5 | 360 | January 1, 2024 | |
Arrays of abstract types within a parametric type | 17 | 1337 | April 21, 2022 | |
Understanding generic functions and parametric types | 3 | 125 | August 4, 2024 | |
Parametric types - type definition in struct name or struct argument? | 8 | 467 | March 30, 2023 |