Why are BlueprintPure and const incompatible?

anonymous_user_d505b203
Wed, 02 Jul 2014 23:32:22 +0000
Blueprint

UFUNCTION has the BlueprintPure parameter for tagging functions without side-effects, and C++ has the const keyword for, roughly, the same purpose. But if you try to declare a member function such as:

UFUNCTION(BlueprintPure, Category=Foos)
FVector GetFoo() const;

UHT will complain with the message:

Cannot mark function 'GetFoo' as both 'BlueprintPure' and 'const'

Why is that? Const-correct code is generally A Good Thing in C++, but presumably BlueprintPure allows Unreal to reap some sort of optimization. Am I losing anything if I just tag my const function as BlueprintCallable instead?

7 posts - 1 participant