Nope, Execute / ExecuteIfBound / Broadcast are declared in the subclasses.
Why not templatize the whole delegate type ?
template<typename OutStructType, typename DelegateType>
void SubscribeStruct(const FString& Destination, DelegateType Delegate)
{
Delegate.ExecuteIfBound(ResponseData);
}
Alternatively, you can reproduce the auto-generated ExecuteIfBound call…
Should look like this :
if (Delegate.IsBound())
{
struct FParms { OutStructType Data; } Parms = { ResponseData };
Delegate.ProcessDelegate<UObject>(&Parms);
}
It’s not quite ideal though as you might not get any compile warning if you change the delegate signature, but probably crash at runtime.