Fast IsA() implementation


In case fast IsA() implementation is enabled, we will have multiple inheritance of class UClass (Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h) from UStruct (public inheritance) and from class FFastIndexingClassTreeRegistrar/FClassBaseChain (private inheritance) depending on exact implementation. Both UClass and FFastIndexingClassTreeRegistrar/FClassBaseChain contain non static data. In general it is bad practice, because it can lead to problems with pointers during casting, etc.

New parent classes are used just for some implementation. Looks like we don’t really need their interface (please correct me if I’m mistaken). In this case it is generally recommended to use composition instead of private inheritance.

Can anyone explain, what was the reason to use private inheritance instead of composition in this case?