Generic parameter in DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam?

I’ve been scratching my head for hours on how to convert this C# code to C++:

public delegate void Delegate<T>(T DelegateParam) where T : MyClass;

I’ve tried a lot, but all failed. Here’s my current implementation that doesn’t work (I forgot about the other tries that I’ve done due to frustration):

template<UMyClass* T>
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDelegateName, T, DelegateParam);

Hi,

You can’t create delegate templates. You could create a TFunction template:

template <typename T>
using TDelegateName = TFunction<void(T*)>;

… but as these are not exposed to UE reflection as dynamic delegates are, this is probably not what you want.

Steve