Pure functions

You are correct that our use of BlueprintPure isn’t exactly a match for purity in functional languages. The contract states only that there will be no side effects, but many BlueprintPure methods can and will consume object or world state:


/// This function fulfills a contract of producing no side effects, and additionally implies BlueprintCallable.
BlueprintPure,

BlueprintPure is a contract that a programmer promises to adhere to, but the C++ implementations are not verified as we have no realistic method to enforce it in C++. If you see any methods marked BlueprintPure that have side-effects, please file that as a bug.

Cheers,
Michael Noland

1 Like