In other words, when MemberFunc
and PureFunc
are invoked in their own class, why is the Target pin mandatory/explicit for MemberFunc
but optional/implicit for PureFunc
?
Quoted from UE documentation:
The main difference is that Pure Functions promise not to modify state or the members of the class in any way, while Impure Functions are free to modify state. Pure Functions are generally used for getter Functions or operators that just output a data value.
It looks like pure functions are member functions decorated with a trailing Both are actually just member functions. It does not make sense if Target pin is explicit for mutating member functions but implicit for im-mutating ones.const
in C++. Correct me if I am wrong.
Any directions are welcome! Thank you in advance!
Edit: I just noticed by experiments that pure functions are not the same as member functions decorated with a trailing const
. It means that pure function can still be abused to change data members.