BlueprintPure vs C++ const

BlueprintPure UFUNCTION specifier indicates that this function does not affect the owning object in any way (think c++ const) and will not need an execution pin, but can be called on demand

There is some debate on how close BlueprintPure and c++ const actually are since c++ const does not imply purity; const functions may modify mutable members and global state.

AFAIK current best practice is to declare functions as c++ const and BlueprintCallable which allows it to be treated as BlueprintPure by the compiler

You can mark a function as BlueprintPure=false to re-gain the execution pins if needed

UFUNCTION(BlueprintCallabe, BlueprintPure=false)
int Foo() const;

Last updated