![visual basic net list visual basic net list](https://xunit.net/images/getting-started/netcore/new-project-step1-vs2019.png)
![visual basic net list visual basic net list](https://www.vbtutor.net/wordpress/wp-content/uploads/2015/03/VB2015_fig6.2.jpg)
You make copies of structures all over the place. I was thinking about how this would work. You can't have a default constructor, and it would make sense that you can't initialize a reference type in the fashion I showed, because shallow copies happen so often with structures.ĮDIT: TG snuck in ahead of me, again. I was wondering about that, but I create structures so rarely (and wouldn't use one in this case) that I don't know all the limitations. You SHOULD be using a class, in this case, but it isn't relevant, as TG pointed out while I was writing a lengthier response. Creating the list is essential whether you use a class or a structure. You don't technically need that, and I was really thinking of a more elaborate solution involving a copy constructor, but you aren't actually showing any need for a copy constructor in your example, so that may never be relevant. What a structure doesn't give you is the ability to add a constructor that takes no parameters. They'd have distinct T values, but they'd share the same list, as only the reference to the list would have been copied, since the reference to the list is all that is in the structure.ĮDIT: I see I mentioned that changing it to a class would give you a means.yet I didn't explain that. Every time you tried assigning one structure to another, you'd end up with.well, with a pair of structures that are entwined.
![visual basic net list visual basic net list](http://i.ytimg.com/vi/0X8lcO3qrOY/hqdefault.jpg)
End StructureThat would likely work, though it isn't a great solution because of this being a structure.