Pointer to member (function)

Greetings,
I use in ordinary c++ code

std::function<void()> fn;

to reference a pointer to a member. Is there something equal in the UE 4 API? And how does the binding work with the UE 4 variant?

I need a UPROPERTY and UE 4 doesn’t recognize this type
Note: there are more then a void() pointer please give me a general answer :slight_smile:

Thanks a lot :slight_smile:
Conan

I think you should check delegates out:

I don’t know much about how they work, I only used it for timers

UPROPERTY (As all U macros) support only types that UE4 reflection system does and it not support standard library C++ types, only types in UE4. But you can still use it as you wish but without reflection (remove property). Alternative for what you trying to do is delegates as balazon mentioned.

You could add support for this type, but then hou would need to modify UnrealHeaderTool and code UField for it, as well as whole UI supportin editor. It would be better if you implement this as UE4 type too, so any game code would not refere to C++ standard library.