I’m reading the source code of UClass then I found a ClassConstructor variable which point to a static function:
static void __DefaultConstructor(const FObjectInitializer& X) { new((EInternal*)X.GetObj())TClass(); }
In this function, it just called the constructor function of current class’s object with a FObjectInitializer.
I understand how it work, but why? Why they need to use this work?
I mean if we directly use placement new operator ?