Constructor with or without FObjectInitializer

This is because constructors do not have proper inheritance, a constructor of a derived class needs to perform more things than that of a base class has to. Which is the initialisation of its data members, which the base class cannot and will not know about.

Edit i should also say that destructors are the same as constructors, they are never inherited and therefore never overridden.

Here is an exercise

Can this code compile? Can it run ? What will it do if it can ?



class ABaseClass : public AActor
{
     GENERATED_BODY()
public:  
     AMyActor(const FObjectInitializer& ObjectInitializer);
}


ABaseClass::ABaseClass(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
     // Some use of ObjectInitializer

}


class ADerivedClass : public ABaseClass 
{
     GENERATED_BODY()
public:  
     ADerivedClass();
}


ADerivedClass::ADerivedClass()
{
     // What would happen here ?
}