Array of delegates

Had the same problem recently, implemented this workaround, maybe it will work for you.


USTRUCT()
struct YOURGAME_API FDelegateWrapper
{
GENERATED_BODY()

FDelegateWrapper(){}

FDelegateWrapper(FDelegateHandle InDelegateHandle)
: DelegateHandle(InDelegateHandle)
{

}

FDelegateHandle DelegateHandle;
};

Usage like this:


FSomeDelegate SomeDelegate;

TMap<int32, FDelegateWrapper> MyMap;

MyMap.Add(10, FDelegateWrapper(SomeDelegate.GetHandle()));

MyMap[10].DelegateHandle.Reset();