Daily Unreal Column #31 - ThisClass typedef
One of the hidden helpers in Unreal Engine source code is a ThisClass typedef generated by unreal header tool.
Using ThisClass
instead typing full class name is an amazing time saver when writing code. In fact, not only does it allow you to save some time on typing but it also ensures that renaming a class name doesn't mess up your delegates bindings.
Here is an example usage of ThisClass
:
auto* Comp = FindComponentByClass<UPrimitiveComponent>();
Comp->OnComponentHit.AddDynamic(this, &ThisClass::OnComponentHit);