Code:
TMap<EPlayerControllerId, TArray<struct FPawnUniformColors>> TeamColors;
Error in compilation: error C2036: ‘const FPawnUniformColors *’ : unknown size
EPlayerControllerId is an enum.
FPawnUniformColors is a struct forward declared here, but in the cpp file the include to the source exists.
Looking for a workaround here. When I try to apply it to blueprint I get “nested container types are not supported”.
I use this setup with class pointers just fine, so my fast work around is to make FPawnUniformColors a UObject instead and make it a class type, but that annoys me that I have to do that.
Can someone shed some light on what is going on here?
EDIT: for lolz I put the #include statement in the .h file that existed in the cpp file. So now the #include statement where this struct resides is in both. That fixed the problem.
That doesn’t make much sense to me though. If its in the .cpp file, I don’t see why it can’t find the array size… but if I put the include in the .h file suddenly it works. Up to this point I have always put my includes largely in the cpp files. I suppose my root problem here is a C++ failure to understand when to put includes in .h vs .cpp.