Coyote on Nostr: bonkmaykr It might be an issue with the way I keep things inside vectors How are you ...
bonkmaykr (nprofile…kwjl)
It might be an issue with the way I keep things inside vectors
How are you keeping them? If you're keeping them directly inside the vector than you're probably slicing all your objects. Inheritance based polymorphism only works if you're taking pointers or references to the derived objects or with derived objects have the same size as their ancestor (i.e. no non-static member variables).
It might be an issue with the way I keep things inside vectors
How are you keeping them? If you're keeping them directly inside the vector than you're probably slicing all your objects. Inheritance based polymorphism only works if you're taking pointers or references to the derived objects or with derived objects have the same size as their ancestor (i.e. no non-static member variables).