Can i have a list of structs with different parameters?
Lets say I have a struct like the one below, is it possible to have a list of structs that have different values inside their compile time parameters? This is just a sample struct, I know it's trivial and you wouldn't create a Name struct but this is just demonstrate the concept.
I could only implement it if I had DataSize as the same for each, but I would like to have a list of different DataSize name structs.
Is there a way to abstract it away, by using traits with all the necessary methods and then a wrapper struct that holds a name field with the trait as its type that I put each Name struct into? Then I could put the wrapper struct as a parameter in DynamicVector?
1 Reply
I've been attempting to solve this, but I'm having difficulty abstracting it away into a wrapper struct using traits. Here is the wrapper struct and sample code to try to run it that I added:
Can anyone help me with trying to solve this? I want to have a DynamicVector with different size Name structs.