When UCLASS declared with "Const" cant declare BlueprintImplementableEvent. [Bug?]

When UCLASS declared with “Const” cant declare BlueprintImplementableEvent. Because const added to function.

When you try, you get error.

Error C2511 : ‘void UClassX::FunctionY(void) const’: overloaded member function not found in ‘FunctionY’
Error C2671 : ‘UClassX::FunctionY’: static member functions do not have ‘this’ pointers
Error C2352 : ‘UObject::FindFunctionChecked’: illegal call of non-static member function

Hi,
Did you manage to solve the issue?
I’m facing the same trying to subclass ‘UAnimNotifyState’.
I removed the const, deleted the .generated stuff and still it adds const to my BlueprintImplementableEvent :cry:

I think I’ve removed “const” from class declaration.

Saddly that did not work for me (using UE 5.0.3).

But that may be because we have a different class inheritance.
Posting my exp for anyone else that may profit in the future.
I did remove ‘const’ from my class, but the class I inherit from (UAnimNotifyState) has ‘const’ too.
‘Const’ is carried on childs no matter what. It also forces every BPImplementableEvent and BPNativeEvent to be const. It also forces every UProperty to be const. This likely infects BPCallable methods…

Possible solution:
I could have gone and remove ‘const’ from the unreal’s class… but that’s a bit dirty.
Or copy the entire unreal’s class and remove const from there. But meh.

Instead I just wrote my code in the cpp class. F*k Blueprints anyway :wink:

1 Like

Should we consider this as a bug?

I dont think so.
It is the expected behaviour of ‘const’.
It’s just annoying that it is used here.