A pure function can even change data member's value?

+This is what I have read in the document: “Pure Functions promise not to modify state or the members of the class in any way”
(Functions | Unreal Engine 4.27 Documentation)
+But the example in the picture show that a function marked with pure can even change the member value and give no error
; Am I missing or misunderstand something ? please help

i think that promise is from the developer not the function haha

you can do it but generally shouldnt as it may cause bugs

1 Like

Auran, it didn’t give error from beginning, I thought UE5 is the best? :slight_smile:

because you can do it and it does work its just dangerous :wink:

2 Likes

the statement is from UE4.27, but now it is already UE5.3 ; but Epic Game still not fix it? :roll_eyes:

my point is its not a bug, there are uses for it you just have to be careful

2 Likes

thanks for your help Auran

This line should be included in the documentation. BPs dismiss most aspects of what pure stands for. BPs pure is more like: a function with no execution pins that is more tricky to use. As mentioned by @Auran131, you must police yourself.

1 Like