Following this tutorial, I bumped into this keyword in the constructor of my custom gamemode:
AFPSGameMode::AFPSGameMode(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
On the other hand in the costructor prototype the “class” keyword disappear:
AFPSGameMode(const FObjectInitializer& ObjectInitializer);
Why? What’s the utility of this keyword?
Sometimes, you may have a situation when you need to use a class which is not defined yet. For example, class A should know about B, and class B should know about A.
This code is equivalent to that:
class B* pB;
class A* pA; // it is not necessary to use class keyword here cause class A has already defined
Best regards, Gleb