Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 4
Simple commented code about it:
https://code.sololearn.com/cK1wVF5rxldO/?ref=app
+ 2
it just ensures that there is only one copy of the base class in the inherited objects, you don‘t really need to understand it further than that, but basically you get a vtable for each object you inherit from, but since the objects inherit virtually from the base class you only get one instance of the base class instead of one for every vtable