I was attempting to improve readability of some of my multicast delegate definitions by spreading the definition over multiple lines. However, simply adding a newline causes a compile error.
This compiles:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSomeDelegateType, int32, ParamName);
This does not:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSomeDelegateType,
int32, ParamName);
The only difference between the two is I added a newline after the delegate name and before the parameter list. I get the following compile errors:
MyObject.h(13): error C2143: syntax error: missing ';' before '<class-head>'
MyObject.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
MyObject.h(13): error C3861: 'FSomeDelegateType_DelegateWrapper': identifier not found
MyObject.h(13): error C2143: syntax error: missing ';' before '<class-head>'
MyObject.h(14): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
MyObject.h(13): error C3861: 'FSomeDelegateType_DelegateWrapper': identifier not found
This is using the launcher version of UE 4.16.1 with a Visual Studio 2017 solution. Here’s a sample project with this issue: DelegateTest Project