Do you guys think you could consider adding a UCLASSNAME() macro? It would return the name of the current class in which the macro is called.
Example use case:
// In the class below, UCLASSNAME() would return "ASomeActor" (sans quotes), concatenated with whatever __VA_Args__ returns
#define UCLASSNAME(...) // Implementation here...
UCLASS()
class MYGAME_API ASomeActor : public AActor
{
GENERATED_BODY()
void MyExampleFunction()
{
TObjectPtr<TSubclassOf> MyClassVar = UCLASSNAME(::StaticClass);
if (GetWorld())
GetWorld()->GetTimerManager().SetTimer(THANDLE_MyExample, this, &UCLASSNAME(::TimerFunctionName), 1.f, true);
}
};
I think this would have great benefit in that I don’t have to hard code class name values in a lot of code. Plus something like this becomes a lot more valuable as the project gets larger.