If I want to use blueprintable delegates I can just use second type and I must specify types only supported by blueprint: such as int32, TArray, UObjects, etc.
But if I want to use TMap in first type delegates? DECLARE_DELEGATE_TwoParams(FDelegateName, int32, TMap);
But this declaration failed because in round brackets of macro substitutor used three comma instead two (in TMap template there additional comma).
So I can’t use TMap in delegates?
Or I can use special macros to avoid this?
For example
#define COMBINED(a, ...) a, ##__VA_ARGS__
DECLARE_DELEGATE_TwoParams(FDelegateName, int32, COMBINED(TMap<int32, UObject>));
Or there another way to declare delegates?
And can I use TMap in DECLARE_DYNAMIC_MULTICAST_DELEGATE without exposing to blueprint?
I’m not quite sure what you’re asking to be honest. So I’ll attempt to answer it this way… I don’t think you can use a TMap with a dynamic multicast delegate since IIRC all parameters must be UObject/UStruct or the like. Also I’m not sure the best way to get around compiler errors with delegates and templated classes like TMap, but the easiest I’ve seen was to typdef it and use the typdef instead of the full template. So for example…
Thank you for answer, Koderz.
Okay, typedef sounds better then using macro, but if I used this for code generation, with variadic parameters and variadic types of parameters, typdef is excess.