DECLARE_DELEGATE_OneParam makes compile error on param being a TMap

Hi,

Mixing macros and multi-argument templates in C++ don’t work so well, because the commas in the template are parsed as part of the macro instead:

First arg: SetArmorDelegate
Second arg: TMap<int
Third arg: FString>

For native code, you should use a typedef instead:

typedef TMap<int, FString> FMyMapType;
DECLARE_DELEGATE_OneParam(SetArmorDelegate, FMyMapType)

For UHT, the only workaround I would suggest is to wrap it up in a USTRUCT:

USTRUCT()
struct FMyTypeContainingAMap
{
    TMap<int, FString> Map;
};

DECLARE_DELEGATE_OneParam(SetArmorDelegate, FMyTypeContainingAMap)

Hope this helps,

Steve

1 Like