Hey I have created a UINTERFACE which is solely implemented by actors which has a const function for returning a pointer to itself. Problem is the pointer created to itself using ‘this’ becomes const in a const function. I was wondering what the best approach to removing the const is with UE or if I should make the function non const.
It looks like the following:
UINTERFACE header file:
virtual AActor* GetImplementingActor() const = 0;
Implementing AActor header file:
FORCEINLINE AActor* GetImplementingActor() const override;
Implementing AActor source file:
AActor* AGCoreCharacter::GetImplementingActor() const
{
return this /* error */
}