I noticed in the 4.12 release notes that BlueprintPure metadata was added: “New: Added “BlueprintPure=false” metadata to allow const functions to be exposed to Blueprints as non-pure.”
I’ve tried to use this in my code, but the node still appears as a BP Pure node.
I was hoping to be able to use a const function without needing to create a local copy to avoid doing the same work during a “Get” (const correctness is important in our project).
Am I using it wrong, or am I otherwise misunderstanding the purpose of the flag?
For future reference, I had learned about this from the 4.12 notes: “New: Added “BlueprintPure=false” metadata to allow const functions to be exposed to Blueprints as non-pure.”
I’ve recently tried it in 4.17 and it is functional (it was quite possibly functional in 4.12 but I wasn’t using it correctly.)
eg.
//This function is C++ const but not BP pure
UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "GameData")
void GetUnitDataRow(const FName& UnitName, bool& OutFound, FDataTable_Units& OutUnitRow) const;